Draped in a rainbow flag and blowing kisses, Britney Spears wowed a crowd of 57,000 at Brighton Pride in her first UK performance for seven years.
The superstar headlined the opening day of the festival, kicking off a European tour of her Las Vegas show Piece of Me.
Afterwards, she tweeted: "Thank you for a fabulous show...my fabulous fans. I love you all."
But thousands of fans were later said to be stranded overnight after chaotic scenes at the city's railway station.
Britney returns to the UK in two weeks for shows in Scarborough, Manchester, Glasgow and London.
Dressed in a sequinned leotard and thigh-high stockings, she treated the Brighton crowd to classics including Baby One More Time, Oops!... I Did It Again and Toxic.
Just as in her Las Vegas residency - which ran on and off for four years from December 2013 - the audience was given a performance of slick routines, with around 20 backing dancers, and countless costume changes.
Her other numbers included Boys, Me Against The Music, Piece of Me, Gimme More and Womaniser.
The routine also found room for a tribute to songs by rapper Missy Elliott.
The 90-minute set was rounded off with an encore in which she danced with a rainbow flag and blew kisses to fans.
Excitement for Britney's headline performance had reached fever pitch throughout Saturday, with many people wearing Britney masks and dressing up in some of her most famous outfits from her music videos.
Earlier in the day, people tweeted about the chaotic scenes at London's St Pancras Station as they queued for up to 30 minutes to buy their train tickets to Brighton.
After the show, police requested Brighton's main railway station be closed and train services suspended shortly before midnight to help them deal with growing crowds.
Carl Smith, who was was caught up in the chaos, said: "There was just loads of crushing. There were people passing out - there was no water.
"Trains had been going but with no-one on them. Our friend managed to get through the barrier somehow. He texted me and said 'I'm on an empty train going back to London. Why are there still thousands of people outside?'."
A Govia Thameslink spokesperson said: "At around 11.40pm the police requested that we close the station and suspend train services temporarily to help them control the crowd outside the station, and then allow people into the station in a controlled manner.
"We ran further extra trains, and the station steadily cleared, with the last extra train leaving at 2.15am."
Brighton & Hove City Council added: "Many people decided not to travel and went to the beach instead, the numbers were added to by others leaving the Pride Village Party and also heading to the seafront. This led to overcrowding in some areas and an increase in calls to emergency services.
"We have been working with the ambulance service and HM Coastguard to find a way to reduce the numbers of people on the beach for the safety of all."