During the 1980s, U2 became entranced by America. Especially Bono. Though born and raised in Ireland, the singer obsessively mined the United States for lyrical inspiration. His gaze fell frequently on lingering injustice: civil rights struggles, Martin Luther King, Jr.'s murder, greedy televangelists. On Rattle and Hum, the band's messy 1988 sorta-soundtrack, the obsession expanded to include gospel ("Angel of Harlem") and blues ("When Love Comes to Town") and high-profile guest appearances from an older, more settled generation of classic rockers: Bob Dylan, B.B. King, even Jimi Hendrix's ghost (in the form of a "Star Spangled Banner" excerpt).

During the 2010s, Kendrick Lamar chronicled the bruised and broken promises of life in White America on rap albums drenched in jazzy paranoia. On 2015's To Pimp a Butterfly, he set his ruthless critiques to sprawling, sputtering funk-inspired beats. On tracks like "Alright," Lamar nodded to the Black Lives Matter movement and the swell in public attention to police shootings of black men. Butterfly inspired everyone from David Bowie to Kanye West to Barack Obama, who publicly expressed admiration for "How Much a Dollar Cost."

Now it's 2017 and lyrics about racial injustice are still disturbingly relevant and U2 is among that settled generation of classic rockers making high-profile guest appearances. Here's proof: Kendrick Lamar—who was not yet born when The Joshua Tree first came out—has gone ahead and featured U2 on his anticipated and enigmatic new album, DAMN.

The album also has an appearance by Rihanna and a pretty glorious hook by Zacari ("LOVE"). But when the track listing—with its odd, all-caps stylization—was revealed last week, lots of fans zoomed in on the U2 credit. For younger listeners who might only know U2 from Joshua Tree singles, "Vertigo" and the iPhone debacle, the choice seemed puzzling. Others worried the cowriting credit was nothing but a sample—maybe a corny snippet of "Beautiful Day" or "Walk On." Some critics wondered how the collaboration might impact Lamar's seemingly unimpeachable critical reputation or U2's recently irredeemable one.

Will the Kendrick/U2 collab get critics to criticize Kendrick, or to praise U2? Unstoppable force, meet immovable object

The nervousness was misplaced: "XXX," the song with the U2 credit, is an easy highlight, and the most urgent that Bono has sounded in years. The song is frenetic and fiery, with sirens squealing around the outer edges of the beat and some of the angriest, most pointed lines on DAMN: "Ain't no Black Power when your baby killed by a coward / I can't even keep the peace, don't you fuck with one of ours." Bono's hook appears more than midway into the song. "It's not a place," he sings, in a low register, over trip-hop rhythms. "This country is to be a sound of drum and bass / You close your eyes to look around." The vocal appears once more to close out the song.

What is most striking about "XXX" is how vividly it addresses the same themes U2 grappled with in the '80s (before Bono started meeting routinely with world leaders): the substantial gap between the academic ideal of American democracy and the more harrowing realities of the red, white and blue. But where U2 frequently addressed a historical past ("Pride," "MLK"), Lamar's rhymes are more fixated on a terrifying present ("Homicidal thoughts, Donald Trump's in office / We lost Barack and promised to never doubt him again / But is America honest, or do we bask in sin?").

The musical gap between U2 and rap music was vast in the '80s, less so in the 1990s, when the band became dazzled by samples and dance beats and when genre-bending acts like Beck split the difference between indie-rock and hip hop. Achtung Baby, the 1991 masterpiece, was the crossover. In 1993 (the same year Beck released "Loser"), U2 made its most adventurous record, Zooropa, which is very good and probably the only album in the world that features both industrial beats and a Johnny Cash guest spot. Between the heady electro rush of "Daddy's Gonna Pay For Your Crashed Car" and The Edge's mumble-rap delivery on "Numb," it's a wonder more rap acts haven't turned to it for inspiration.

U2 risked irony overload on the follow-up, 1997's glitzy Pop, but still managed to flirt impressively with trip-hop ("The Playboy Mansion"), grinding techno ("Discotheque," "Mofo") and ambient ("If You Wear That Velvet Dress"). It's a neat album, if not another masterpiece. The album and oversized tour provoked a considerable backlash; U2 played it relatively straight on 2000's All That You Can't Leave Behind and on pretty much everything since then. By the time Lamar rose to prominence in 2012, U2 had squarely settled into classic rock territory.

I don't know how much Kendrick Lamar has listened to U2's troubled and fascinating '90s albums. Maybe a lot, maybe not at all. I also don't know whether it is a coincidence that two other titles on his album, "PRIDE" and "GOD," seem to explicitly evoke U2 songs by name ("Pride," "God Part II"").

But what's most striking about "XXX" is that Lamar yanks U2 out of their comfort zone—no ringing guitars, no soaring choruses—and that he refuses to indulge Bono's ego. It's a brief spot. Nothing extravagant. Sort of like how Kanye West used Frank Ocean on The Life of Pablo. Zone out for a minute and you'll miss it.

Maybe Lamar will repay the favor and appear on U2's next album. It's been a while since the band's only rap song, "Numb." And The Edge's rapping skills aren't hard to beat.