The US rapper concluded proceedings at Worthy Farm in Somerset with one of the most theatrical shows of the festival.
The Pulitzer Prize-winning rapper, 35, ensured his debut at the festival would be memorable with an array of hit songs from his back catalogue accompanied by finely choreographed dancers.
The performance reached its theatrical pinnacle at the end as the lights came up during his rendition of new song Saviour to reveal fake blood was pouring down his face from a crown of thorns.
Before playing the song, Lamar, who has previously been open about his Christian faith, said the crown of thorns represented Christ.
The crown which adorned his head was reportedly made by Tiffany and Co, and features 8000 diamonds, according to British Vogue.
The words “You Saviour I Am Not” blazed on the screens behind him as he performed the track with fake blood continually pouring down his face and white shirt.
As his dancers encircled him, fireworks erupted across the stage as he repeatedly chanted “they judge you, they judge Christ. Godspeed for women’s rights” before leaving the stage.
The plea for female rights appeared in protest against the US Supreme Court’s recent decision to end the country’s constitutional right to abortion.
A number of musicians across the weekend used their Glastonbury platform to condemn the reversal of the landmark 1973 Roe v Wade ruling including Lorde, Billie Eilish, Olivia Rodrigo, Idles and Phoebe Bridgers.
Earlier in his set, Lamar thanked the crowd for the “special moment” as he had been waiting to be back performing live after being locked away during the pandemic.
The rapper added: “I look in the crowd, I see so many faces, different creeds, different colours, so many faces, ya’ll blessed me to be up on this stage.”
He explained that during the lockdown period he wrote his newly-released album, Mr. Morale & The Big Steppers, which he said includes material which people “can feel” as he believes “everybody’s going through something”.
Among his set were hit songs from throughout his five studio albums including Money Trees, m.A.A.d city and Swimming Pools (Drank), i, Alright, DNA and BLOOD.
Introducing his track Love, he told the packed crowd of adoring fans: “We’ve got a whole lot of love out here tonight Glastonbury, do you agree?”
As they responded in an eruption of cheers, he added: “Let’s make sure we continue just that.”
Following his song, the audience chanted “Oh Kendrick Lamar” as he listened along, appearing to become emotional as they showed their love to him.
The theatrics continued throughout the night, with Lamar at one point darkening the stage before exploding back into view as red fireworks rained down from above and he started his hit track HUMBLE.
He wore a simple white shirt and black trousers to match his male dancers while the female dancers wore red flowing dresses.
Fans have been long-awaiting Lamar’s headline set as it was announced in 2020 that he would play Glastonbury’s 50th anniversary, but the festival has faced two years of delays due to the pandemic.
Ahead of the rapper’s performance, Lorde took to the Pyramid Stage to deliver a set which moved from melodic moments to high octane energy.
She also called on women to access their “inner wisdom” during the show in protest against the reversing of Roe v Wade.
The stage earlier hosted rock band Elbow, who were joined by a giant puppet of a 10-year-old Syrian and a choir of refugees.
Meanwhile, Diana Ross reeled off hit after hit when she performed during the day’s teatime legends slot.
She kicked off her set with 1980 classic I’m Coming Out, drawing rapturous applause while wearing a sparkly dress with a matching white cape and headpiece ensemble.
The soul singer treated the crowd to a selection of classics including Baby Love, You Can’t Hurry Love, Stop! In The Name Of Love and at the conclusion of Chain Reaction pink confetti was launched from the stage.
She also performed I Will Survive and Ain’t No Mountain High Enough, which she released a hit version of in 1970.
Earlier on Sunday, George Ezra confirmed he was the secret guest on the John Peel stage, three days after pulling out of Tinderbox Festival in Denmark due to a “nasty bout of laryngitis”.
Ezra got his set off to an electrifying start, walking onto the stage to Anyone For You before launching into a rendition of Cassy O’ with hits Hold My Girl, Paradise and Blame It On Me also featuring.
The Hertfordshire singer-songwriter departed the stage following a rendition of Shotgun.
On Saturday evening, Sir Paul McCartney wowed the crowds with a show-stopping set list which included surprise guest appearances from Bruce Springsteen and Foo Fighters frontman Dave Grohl.
As he took to the Pyramid Stage, the former Beatle became the festival’s oldest solo headliner, a week after he celebrated his 80th birthday.
During his more-than-two-hour set, he played a range of classic songs including Hey Jude, Blackbird, Live And Let Die, Ob-La-Di, Ob‐La‐Da and Get Back.
The electrifying show was further amplified as he introduced Grohl to the stage to sing I Saw Her Standing There and Band On The Run, marking Grohl’s first public performance since the death of his Foo Fighters bandmate, drummer Taylor Hawkins.
Springsteen took to the stage to play Glory Days and I Wanna Be Your Man alongside Sir Paul.
As part of the encore, through special technology which could isolate John Lennon’s vocals from old recordings, Sir Paul was able to duet The Beatles’ track I’ve Got A Feeling alongside his former bandmate.
It came after Billie Eilish became Glastonbury’s youngest solo headliner the night before.