The Tokyo Olympics, postponed and played out behind closed doors because of the Covid pandemic, concluded with an upbeat ceremony in Japan's capital.
The Games took place without spectators and athletes were barred from venturing outside the Olympic village.
Their staging has faced local opposition and around 30 protestors jostled with police at the National Stadium before the closing ceremony.
However, other locals have braved heat and warnings to watch events from afar.
Fans took in outdoor events, such as triathlon and BMX, from overpasses and other vantage points despite temperatures that reached 35C, the hottest ever recorded at an Olympics.
The Games' official sign-off, featuring ska bands, football freestylers, breakdancers and BMX riders, created more made-for-TV memories, culminating in athletes thanking the people of Japan by making a heart gesture with their hands.
A scaled-down parade of flagbearers, missing 62 of the competing nations, started proceedings in Tokyo before an air display team painted the French tricolore across the sky in Paris, the host city for 2024.
Tokyo 2020 president Seiko Hashimoto, who appeared at seven Games as a speed skater and then a track cyclist, told the athletes: "There are no words to describe what you have achieved.
"You have accepted what seemed unimaginable, understood what had to be done, and through hard work and perseverance overcome unbelievable challenges."
She added: "This has made you true Olympians."
Athletes had daily swabs to test for coronavirus and wore face masks when not eating, training or competing. After they had finished competing, they had 48 hours to leave the athletes' village.
Games produce stars and the unexpected
The Games were postponed a year from their original 2020 date and, as the global pandemic raged, Japanese support wavered, with unfavourable opinion polls in the months before and even the country's Emperor Naruhito expressing concerns about their staging.
The banning of spectators from most venues denied the Japanese public a chance to watch a summer Games close up for the first time since Tokyo 1964 and the climax of an eight-year wait after winning the hosting rights in Buenos Aires in 2013.
- Tokyo 2020 medal table
- Ten heartwarming Tokyo 2020 moments
- How closely have you been paying attention to Tokyo 2020?
- Who won GB's medals?
- Team GB athletes' results
As ever, the Games produced a shower of stars. American swimmer Caeleb Dressel won five golds in the pool. Jamaican Elaine Thompson-Herah won another three on the track. Gymnast Daiki Hashimoto won two for the home nation in gymnastics.
But, equally inevitably, there were moments that no-one could have expected.
Italy's Gianmarco Tamberi and Qatar's Mutaz Barshim deciding to share high-jump gold rather than contest the title.
Norwegian Lotte Miller consoling Belgian rival Claire Michel after she came in last in the triathlon.
Simone Biles, predicted to collect a clutch of golds, instead highlighting athletes' mental health as she protected herself by withdrawing from five of her six events.
The next Olympics begin in just 180 days time with the Winter Games opening in Beijing on 4 February. The next Summer Olympics are just three years away, with Paris hosting in 2024, before Los Angeles 2028 and Brisbane 2032.
Britain match London tally and set sights high for Paris 2024
Despite a build-up blighted by lockdowns, Great Britain surpassed the 51 medals won in Beijing 2008, matched the 65 won in London 2012 and ended just two short of their Rio 2016 total.
Track cyclist Jason Kenny became the first Briton to win seven gold medals as he retained his keirin title, while Laura Kenny became the most successful female cyclist in history as she took her tally of golds to five with madison success alongside Katie Archibald.
There were new stars as well. Twenty-one-year-old Tom Dean won a pair of golds in the pool, Bethany Shriever and Charlotte Worthington took BMX titles, and Keely Hodgkinson, 19, won a superb 800m silver on the track. Emily Campbell won Britain's first female weightlifting medal.
Sky Brown became Britain's youngest ever summer Games medallist in one of the Games' newest sports with a skateboarding bronze.
"Not only has the team made history but it has probably made history on the back of the most complex and most challenging and difficult environment that we will face certainly in my lifetime," said Team GB's chef de mission Mark England.
"It has been against all the odds and I think it is the greatest achievement in British Olympic history.
"This is a very, very young team and a very talented team, and a team I'm absolutely confident that will go to Paris in less than three years and do exceptionally well."
- Team GB Takeover: Find out these athletes' favourite One Hit Wonders
- Homegrown Heroes: How it all started for Blossoms and why they are still true to Stockport