Rihanna and Kendrick Lamar headlined the Global Citizen Festival’s fifth anniversary Saturday night, showing how well music and activism can fit together.

Even before taking the stage, Rihanna had become Global Citizen’s ambassador for education, pledging to lobby world leaders to improve education in the world’s poorest countries.

Lamar’s passionate set balanced politically charged hip-hop like “Alright,” which has become an anthem for Black Lives Matter, with detailed, well-crafted tales of his own life and some special freestyles.

As in previous years, the more than 70,000 fans gathered on Central Park’s Great Lawn could not buy tickets to the show. They had to earn their way in by taking actions to help Global Citizen with its goal of ending extreme poverty in the world by 2030.

Metallica delivered a thunderous half-hour set, getting the crowd to scream along with the “Enter Sandman” lyrics “Exit light! Enter night!” as the sun began to set on the park. The extended version of “Master of Puppets” both showcased James Hetfield and Kirk Hammett’s guitar work and put the song’s lyrics in a new, political context.

Fittingly, it was a day of standout collaborations. Coldplay’s Chris Martin, who curates the festival for Global Citizen, teamed up with Eddie Vedder for a rocking version of Crowded House’s pretty “Don’t Dream It’s Over” recast as a protest and a raucous version of Patti Smith’s “People Have the Power.” Usher, Ruben Blades and the Kenyan Boys Choir teamed up for the moving “Champions.”

But it was Cat Stevens and Vedder’s poignant version of Stevens’ “Father and Son” that made the most lasting impression. Stevens elaborated on the song’s intergenerational discussion by applying it to the world’s current unrest.

“The trouble we see spreading around the world today in different countries is basically not the fault of people’s religion or their color,” he said. “It’s because many of them see their identity has been stigmatized. . . . Hopefully these kind of movements, global citizens, will help to make us a bit more sensitive to others and remind us what it is to be human.”

Usher, wearing a “SILENCE IS CONSENT” T-shirt, offered words of advice to the Central Park crowd and to those watching on MSNBC and on YouTube.

“If you see something going on in the world and you don’t say something about it, it is consent,” he said. “You cannot turn your heads away from the reality. . . . Speak up.”