The 2020 Games defied an extraordinary build-up when they were postponed last year and veered close to the first cancellation since World War II.
Eliud Kipchoge produced a marathon masterclass and the USA edged China at the top of the Olympics medals table as the curtain fell on the biggest sports event.
After Kipchoge's marathon win for Kenya, volleyball, track cycling and basketball wins put the United States top of the medals tally with 39 golds, just one ahead of China in a battle for bragging rights.
The 2020 Games were postponed last year and veered close to the first cancellation since World War II.
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 on Sunday.
"What we have seen here is that on the contrary the athletes have brought soul to the Olympic Games."
The Games have been plagued by low Japanese support over super-spreader fears and the marathon, moved north to Sapporo to avoid Tokyo's summer heat, was one of the few events to allow spectators.
"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."
Athletes, ordered to wear masks when not competing, training, eating or sleeping, have endured the extra psychological strain of strict "bubble" conditions in Tokyo.
The Olympic flag is pass to 2024 hosts Paris at the closing ceremony.
But the circus will reconvene in just six months' time when Beijing, faced with boycott threats and a renewed coronavirus emergency, holds the Winter Games in February.