The legions of ceiling-dancers gathering early for Lionel Richie at Glastonbury’s Pyramid Stage are treated to a whole new level of retro hero worship. And they come no more heroic than Patti Smith, the growling grande dame of the 70s New York punk explosion or, if you like, the female Lou Reed. She opens her set snarling “Come on, come and love me,” during a vitriolic Privilege (Set Me Free) and ends it falling flat on her face “because I’m a fucking animal!” and ripping strings from a guitar one by one. In between she reduces half of Glastonbury to tears, empowers the other half, gives the Dalai Lama a birthday cake and does her damndest to change the world. Needless to say, it’s the set of the weekend.

The Dalai Lama appears on stage with Patti Smith during her Glastonbury festival set on Sunday. Photograph: Samir Hussein/Redferns via Getty Images

She’s a captivating presence, not just for her iconic status and monumental influence but because she remains a righteous voice of protest and rebellion. She dedicates a strident Pissing in the River to “all our friends in Wikileaks”, gives regular shout-outs to the planet and, as 1996’s Beneath the Southern Cross grows from sublime folk ballad to a conflagration of battle drums and guitar fire that must surely have signposted PJ Harvey’s Let England Shake, she tells us to “raise your arms! Feel who you are without technology, without governments… feel your freedom!” Freedom, we decide, feels fairly euphoric.

Most memorably of all, she then hugs Buddha. Kind of. After she recites a poem written for the Dalai Lama’s 80th birthday, His Holiness himself emerges from the wings, receives a rousing rendition of Happy Birthday Dalai Lama, cuts a birthday cake and makes a speech about friendship, trust and “warm feelings” while also complimenting Smith’s “white hair” and “physical action”. It’s as special a Glastonbury moment as any number of All Night Longs, and it inspires Smith to a frenzied close. With the wicked passion of Lady Macbeth summoning her murdering ministers to suckle, she spits out Horses centrepiece Land, improvising its lead character Johnny out of the hallway where he’s spent the past 40 years assessing “what a fucked up world we live it” to Glastonbury “because he wants to party”. As it morphs into her energised take on Them’s Gloria and primes a final clatter through My Generation in tribute to tonight’s headliners the Who, she sets about mutilating a guitar and declares “My generation had dreams and we’re still dreaming! We’re gonna change the fucking world!” Well she certainly left this awestruck corner of Pilton indelibly stunned.