The star was watched by her rapper husband and friend Gwyneth Paltrow as well as 170,000 people on Worthy Farm in Somerset as she tore through an impressive hour and a half set.
Wearing just black hotpants and a gold belted jacket with her hair blowing curly and free in the evening breeze, at times, she appeared overcome with emotion at the reception she was given.
Scroll down for video
Cheeky: Beyoncé was wearing tiny black hotpants and a gold sequinned jacket to headline the last day of the Glastonbury Festival last night
Get ready for the jelly! Beyoncé's husband Jay-Z and her friend Gwyneth Paltrow watched her from the VIP area at the front of the stage
Festival chick: Gwyneth seemed to be having a lot of fun on Worthy Farm as she waited for Beyoncé to take the stage - and took a pic of the photographers in the pit
And even though she's more used to playing to fans in slick arena shows rather than to thousands of festival goers stuck in the mud, she appeared to totally win over the crowd.
Playing a greatest hits set of mostly her own and Destiny's Child tunes, she also covered tracks including Etta James's At Last, Kings Of Leon's Sex On Fire and Alanis Morrisette's You Oughta Know.
Bizarrely, she also duetted with Tricky for song Baby Boy, but the Bristol-born rapper looked rather uncomfortable up there with her on the Pyramid Stage.
Put a ring on it! The star played - and danced - a storming version of her hit Single Ladies
Blown away: At times, the star seemed on the brink of tears she was so overwhelmed by the response from the audience
Impressive: The star was backed by an all-female band and male and female backing dancers as well as a pyramid on stage to reflect the fact she was on the Pyramid Stage
However, she kept fans happy, kicked off with a firework-punctuated Crazy In Love.
She seemed thrilled to be there, declaring: ‘You are witnessing my dream! Thankyou for having me and my band tonight, I always wanted to be a rock star and tonight we are all rock stars.'
She also included tracks including Single Ladies - which of course she did the dance to, in her sparkly black high heeled ankle boots - If I Were A Boy, Independent Women, Bootylicious and Survivor as well as new single Who Run The World (Girls) before closing with an anthemic Halo.
Thighs the limit: The star put in a set that saw her sing to the top of her lungs at the same time as throwing her trademark dance shapes
Lot of love: Despite the likes of Zane Lowe, most people enjoyed Beyoncé's set even if they weren't massive fans
At the end of her ground-breaking set, she declared: 'Can I just say "I love you" to Coldplay and U2, and thanks again for this beautiful night, I will never forget it. I love you all!'
She then disappeared into a glowing pyramid at the back of the set - literally built because it was on the Pyramid Stage.
The star - the first female to headline the festival in more than 20 years - was playing with an all-female band including a horn section with some male backing dancers to even things up a bit.
The star didn't please everyone, however.
Radio 1 DJ Zane Jone churlishly refused to comment on her set in a discussion with BBC 6 Music presenter Lauren Laverne - and caused outrage on Twitter.
Lauren had been saying why Beyonce was a great pop artist who'd put in a fantastic performance in the true spirit of Glastonbury and asked Lowe his thoughts.
Giving her all: The star drew from both her solo and her Destiny's Child back catalogue, as well as covering tracks by the likes of Prince, Kings Of Leon and Alanis Morissette
But Lowe mockingly burst out laughing before simply saying rudely: 'I went and watched Queens Of The Stoneage. Here's Kool And The Gang.'
He had been due to continue hosting the aftershow coverage on the channel - but when it became clear that Beyoncé was going to be doing an interview following her set, he made a rather see-through excuse that he had to leave the site.
BBC Radio 2 DJ Jo Whiley then stepped in to do the interview with Lauren instead.
Already out of her stage costume and wearing jeans and wellies, Beyoncé appeared to be happy with her set.
Rapt: Jay Z and Gwynnie couldn't take their eyes of Queen Bee when she was performing
Beyoncé had done her homework the night before too, and was seen down the front of the stage in the VIP section with rap star husband Jay-Z last night watching Coldplay wrap up Saturday's bill on the Pyramid Stage - and perhaps getting some last minute inspiration.
Beyoncé was seen dressed down in a hoodie dancing and singing along to the band with her husband and frontman Chris Martin's wife Gwyneth.
She told Lauren and Jo that it had made her feel better about what she had to do last night.
Making history: The star is the first woman to headline the Pyramid Stage in more than 20 years
She confessed: 'It made me feel a lot better last night, you realise people just want to listen to great music. I just thought, this is just beautiful. I just thought, calm down girl!'
And she said the weather had worked out well for her too, laughing: 'I'm happy it was sunny, it was beautiful today!'
The diva closed the three-day bash last night, and revealed that she was so nervous about it, she'd talked about her set with both Coldplay and Friday night's headliners U2.