Multi-colour curtain falls on Rio
The curtain descended on two weeks of high drama at the Rio Games, marked by the heroics of Olympics legends Usain Bolt and Michael Phelps as Tokyo took up the baton and promised to go one better in 2020.
As Brazil shrugs off a post-Olympic hangover to face a deepening political and economic crisis, memories of Jamaican Bolt and Phelps will linger after they set the 2016 Olympics alight.
Swimming legend Phelps, Bolt, and an array of others helped the Games rise above the taint of scandal following the exposure of state-sponsored doping in Russia.
And security scares, off-field scandals and organisational gaffes were overshadowed as 16 days of competition ended in a blaze of colour late Sunday with an exuberant closing ceremony.
Smiling and waving athletes danced into the Maracana stadium to launch an all-night party after the Rio Games were described by Olympics chief Thomas Bach as "marvellous."
Joy did come for many Brazilians on the final day and fittingly in football. The home men's national team earned its greatest Olympic memory by winning the men's gold medal.
The country celebrated long and loud when Neymar won a gold-medal penalty shoot-out against Germany to erase memories of their 7-1 World Cup semifinal humiliation in 2014.
In the pool, Michael Phelps swam into retirement, the US great adding five golds to a tally that now stands at 23, among a total of 28 medals. He bowed out with one last 4x100m relay victory that brought tears to his eyes.
But he was also beatable, as Singapore's Joseph Schooling showed in touching out the legend who had inspired him with a historic victory in the 100m butterfly. Phelps finished in a three-way tie for silver.
Then came Rio standout Katie Ledecky. At the age of 19 she obliterated her own world record in winning the 800m freestyle, uniting the 200m, 400m and 800m titles for the first time since 1968. The American added the 4x200m relay gold as a bonus.
Another 19-year-old newcomer, Simone Biles, dominated the gymnastics arena with her record-equalling four women's gold medals and a bronze at her first Games.
Andy Murray also wrote some history, becoming the first tennis player to defend Olympic gold in singles.
The athletics programme produced three world records, including stunning runs in the 400m by South Africa's Wayde van Niekerk and women's 10,000m by Almaz Ayana that both erased marks set last century.
Elaine Thompson pulled off a brilliant 100m-200m double as Jamaica again dominated the sprints, while Briton Mo Farah became the second man to retain the 10,000m and 5,000m titles.
But one man bestrode the whole event, Usain Bolt signing off his extraordinary Olympic career with an unprecedented treble-treble: gold in the 100m, 200m and 4x100m relay for the third time in successive Games.