Eliud Kipchoge produced a marathon masterclass and the USA edged China at the top of the Tokyo Olympics medals table as the curtain fell on the biggest sports event since the pandemic on Sunday.
After Kipchoge's marathon win for Kenya, 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 339th and final gold medal went to Serbia's men's water polo team, capping games that were in serious danger of cancellation after they became the first postponed Olympics last year.
Thirty-three sports have been contested across 16 days in largely empty stadiums, with fans barred over coronavirus risks and athletes living in strict bio-secure conditions.
"Some were already speaking of 'Ghost Games'," Olympics chief Thomas Bach told an International Olympic Committee session ahead of the closing ceremony on Sunday.
"What we have seen here is that on the contrary the athletes have brought soul to the Olympic Games."
The Olympics were plagued by low Japanese support over fears they would become a super-spreader event but officials maintained that a record haul of 27 gold medals, putting Japan third on the table, has won hearts.
"We believe our athletes' earnest spirit and all-out performance moved people," said Tsuyoshi Fukui, chef de mission for the Japanese team.
Britain finished fourth with 22 golds and the Russian Olympic Committee, the team for Russian athletes after Russia were banned for systematic doping, were fifth with 20.
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.
Sunday's closing ceremony got underway at an Olympic Stadium empty of spectators, rounding off an extraordinary Game conducted mostly for a worldwide TV audience of billions.
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 athletes had the added pressure of strict 'bubble' conditions and were instructed to follow orders to wear masks unless competing, training, eating or sleeping.
Victory celebrations have been low-key, with lonely laps of honour and sparsely attended medal ceremonies. But the emotions of the competitors have been 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 return for the final event, the beam, claiming a redemptive bronze.
Weightlifter Laurel Hubbard 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 and US swimmer Caeleb Dressel assumed the mantle of Michael Phelps with five gold medals in the pool.
Among the final events on Sunday, Canadian cyclist Kelsey Mitchell took gold in the women's sprint while Jason Kenny won 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 final table.
Uzbekistan's Bakhodir Jalolov beat US fighter Richard Torrez in the super-heavyweight boxing final, while Britain's Lauren Price and Ireland's Kellie Harrington also boxed their way to gold.
The Olympic flag will now pass to 2024 hosts Paris. 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.