The London 2012 Olympics ended with a spectacular musical closing ceremony and the official handover to the next host city, Rio de Janeiro.
The three-hour show featured some of the biggest names of British pop from decades past, including the Spice Girls, George Michael and Elbow.
Games chief Lord Seb Coe hailed the London 2012 Olympics a big success on Sunday and said thank you during the nation's final farewell to the Games.
Speaking with great pride during the closing ceremony at the Olympic Stadium in Stratford, east London, he said: 'On the first day of these Games I said we were determined to do it right. I said that these Games would see the best of us.
'On this last day I can conclude with these words: "When our time came - Britain we did it right. Thank you!"
The London 2012 chairman, himself a two-time Olympic 1500m champion, recognised the athletes for their world-beating performances, but spoke movingly of how Britain had backed the Games.
Lord Coe said: 'Today sees the closing of a wonderful Games in a wonderful city.
'We lit the flame and lit up the world
The show saw the Spice Girls re-form to sing Spice Up Your Life from the top of five London taxis, and a surprise performance from Take That, who sang their hit Rule the World. It had been thought they would not appear because Gary Barlow was mourning the loss of his daughter who was delivered stillborn last Saturday.
The official Games flag was handed to the mayor of Rio before the flame at the Olympic Stadium was extinguished.
President of the International Olympic Committee, Jacques Rogge, who declared the Games of the 30th Olympiad closed just before midnight, said: "We will never forget the smiles, the kindness and the support of the wonderful volunteers, the much-needed heroes of these Games.
At the close of the ceremony, watched by 10,000 athletes and 80,000 spectators in the stadium along with 26 million TV viewers, the flame was extinguished in dramatic fashion.