The Tokyo 2020 Games were declared closed on Sunday by IOC chief Thomas Bach, who said it had been the "most challenging Olympic journey" after a year's pandemic delay and threats of cancellation.

Bach called the Tokyo Games "unprecedented" as he addressed the 68,000-seat Olympic Stadium, which was empty of spectators as Japan battles 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.

Kenya's Eliud Kipchoge sealed back-to-back Olympic marathon titles
Kenya's Eliud Kipchoge sealed back-to-back Olympic marathon titles AFP / Charly TRIBALLEAU

"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," Bach said.

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.

Artistic swimming featured in the 16 days of competition
Artistic swimming featured in the 16 days of competition AFP / Oli SCARFF

As the Olympic flag was passed to Paris mayor Anne Hidalgo for the 2024 Games, live footage showed cheering crowds in the French capital -- in stark contrast to Tokyo.

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".

Brazil beat Spain in the men's football final late on Saturday
Brazil beat Spain in the men's football final late on Saturday AFP / LOIC VENANCE

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.

Gymnast Simone Biles suffered a mental block that sidelined her from much of the competition
Gymnast Simone Biles suffered a mental block that sidelined her from much of the competition AFP / Lionel BONAVENTURE

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.

Fans were locked out of nearly all of the Tokyo Olympics, including the closing ceremony
Fans were locked out of nearly all of the Tokyo Olympics, including the closing ceremony AFP / Philip FONG

A succession of big names have failed to perform in Japan, where new sports skateboarding, surfing, sport climbing and karate brought young new stars to the fore.

But marathon world record holder Kipchoge showed his class on Sunday, 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.

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.

However, 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 the American 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, US swimmer Caeleb Dressel assumed the mantle of Michael Phelps with five gold medals 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 USA started the day two golds behind China but the women's basketball and volleyball titles and track cyclist Jennifer Valente's omnium victory put them top of the table.

Tokyo will host the Paralympics from August 24. 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.