The Tokyo 2020 Games were declared closed by IOC chief Thomas Bach on Sunday, ending the "most challenging Olympic journey" after a year's pandemic delay and threats of cancellation.
Bach called them "unprecedented Olympic Games" as he addressed the 68,000-seat Olympic Stadium, which was bereft of fans as Japan battles to contain a record coronavirus outbreak.
"In these difficult times we are all living through, you give the world the most precious of gifts: hope," the International Olympic Committee president told athletes at the ceremony.
"And now I have to mark the end of this most challenging Olympic journey to Tokyo: I declare the Games of the 32nd Olympiad closed," he added.
It marked a low-key end to an extraordinary Olympics that have mostly played out in empty venues with only athletes, team officials and media present.
Athletes have lived in strict biosecure conditions with social distancing at the Olympic Village and instructions to wear masks unless eating, sleeping, training or competing.
Bach has described how the IOC considered cancelling the Olympics and claiming the costs on its insurance policy but said officials ploughed ahead with holding the Games "for the athletes".
"Some were already speaking of 'Ghost Games'," he told an IOC session earlier on Sunday.
"What we have seen here is that on the contrary the athletes have brought soul to the Olympic Games."
'Our athletes moved people'
On Sunday, the climax of the biggest sports event since the pandemic, Kenya's Eliud Kipchoge won the men's marathon and the USA edged China at the top of the medals table.
The United States scored victories in volleyball, track cycling and basketball to top the tally with 39 gold medals, just one ahead of China.
The Olympics were plagued by low Japanese support as they went ahead with Tokyo and other regions under a state of emergency and with infections multiplying to new highs.
But Japan's record haul of 27 golds to finish third on the table has won hearts. Britain were fourth with 22 and the Russian Olympic Committee, the team for Russian athletes after their country was banned for systematic doping, were fifth with 20.
"We believe our athletes' earnest spirit and all-out performance moved people," said Tsuyoshi Fukui, chef de mission for the Japanese team.
A succession of big names have failed to perform in Japan, where new sports skateboarding, surfing, sport climbing and karate have brought young new stars to the fore.
But marathon world record holder Kipchoge showed his class, kicking in the closing stages and clocking 2hr 08min 38sec to retain the title he won in 2016.
"I know there were a lot of people against holding this Olympics due to the coronavirus," said a flag-waving, 47-year-old fan on the marathon route who gave his name as Tsujita.
"But I am glad it took place. This was a once-in-a-lifetime experience for everyone."
The marathon, moved north to Sapporo to avoid Tokyo's summer heat, was one of the few events to allow spectators.
Trans athletes, 'twisties'
Fears of a major outbreak among the mostly vaccinated Olympic athletes and officials proved unfounded and 430 cases were picked up during the Games, including 32 in the Olympic Village.
But the virus has lurked as an ever-present threat. Victory celebrations were muted, with lonely laps of honour. But the athletes' emotions were on full view.
Superstar gymnast Simone Biles provided the most jaw-dropping moment when she abruptly pulled out of competition over a bout of the "twisties", a disorientating mental block.
Biles, widely acknowledged as the greatest gymnast in history, recovered sufficiently to claim a redemptive bronze medal in her final event, the beam.
Weightlifter Laurel Hubbard of New Zealand became the first openly transgender woman to compete at the Games and Canada's Quinn became the first openly transgender Olympic medallist, with gold in the women's football.
In other highlights, the US men's team won their fourth consecutive men's basketball crown, US swimmer Caeleb Dressel assumed the mantle of Michael Phelps with five gold medals in the pool and Jamaica's Elaine Thompson-Herah achieved a sprint double on the track.
Among the final events on Sunday, Jason Kenny claimed the men's keirin to become the first Briton to win seven Olympic titles.
The Americans started the day two golds behind China but the women's basketball and volleyball titles and US track cyclist Jennifer Valente's omnium victory put them top of the table.
The Olympic flag was passed to 2024 hosts Paris at the ceremony. But the Olympic circus will reconvene in just six months when Beijing, faced with boycott threats and a renewed coronavirus emergency, holds the Winter Games in February.