Years of waiting, mismanagement, scandal and a pandemic all culminated in Japan having its best Olympics ever on the medal table, even though there were virtually no home fans in stadiums to enjoy the successes.

Under the circumstances of a pandemic, athletes' smiles on podiums were hidden by masks and the streets of the host city were free of Olympic revelry.

But amid the strangeness, there were highlights that showed the "Olympic spirit" might be more than a feel-good marketers' dream.

(From L) Silver medalist Tin Srbic of Croatia, gold medalist Daiki Hashimoto of Japan and bronze medalist Nikita Nagornyy of the Russian Olympic Committee pose with their medals for the men's horizontal bar at the Tokyo Olympics on Aug. 3, 2021, at Ariake Gymnastics Centre, wearing masks for protection against the coronavirus. (Kyodo) ==Kyodo

U.S. swimmers wearing masks for protection against the coronavirus pose for a photo after winning the men's 4x100-meter medley relay in a world record time at the Tokyo Olympics on Aug. 1, 2021, at Tokyo Aquatics Centre. (Kyodo) ==Kyodo

Mutaz Essa Barshim of Qatar, Gianmarco Tamberi from Italy and a masked high jump official together created a moment of true joy when the latter offered the deadlocked jumpers the chance to share an Olympic title.

A grasping of hands and a hug later, there were two men's high jump gold medalists and a pandemic-jaded world took heart from a split-second decision to share ultimate success.

Italy's Gianmarco Tamberi (L) and Qatar's Mutaz Essa Barshim smile with their gold medals for the men's high jump at the Tokyo Olympics on Aug. 2, 2021, at the National Stadium in Tokyo. (Kyodo) ==Kyodo

Athlete mental health became an overarching narrative of the games when gymnastics superstar Simone Biles, one of the American faces of the games, stepped back from competition in a self-preservation move.

Saying she does not "trust myself as much as I used to" and that high-stress situations can lead to a "freak out," the four-time Olympic gold medalist from 2016 withdrew from her title defense in each.

Biles' trials brought a wave of support from across the sporting spectrum, from Irish golfer Rory McIlroy, saying "I 100 percent agree with what Simone is doing" to American softball player Cat Osterman commending her "for stepping out and saying 'I can't do this right now.'"

Simone Biles of the United States competes in the women's balance beam final of the Tokyo Olympics on Aug. 3, 2021, at Ariake Gymnastics Centre. (Kyodo) ==Kyodo

Japanese athletes were not immune either, with trampoline gold favorite Hikaru Mori saying the pressure to perform "was getting harder and harder to deal with" and played a role in her qualification flame out.

But with a record 27 gold and 58 total medals, failure was generally not a major problem for Japan.

Fifteen athletes from the host nation had more than one medal placed around their necks, more than the previous record of eight from the 2004 Games in Athens.

The host nation's gold medal total is 11 more than its previous highs from 2004 and 1964. Its total medal haul is 17 more than the record 41 earned in Rio de Janeiro in 2016.

The highlights came from new Olympic sports, the sports in which Japan is traditionally strong and from some unexpected sources.

The skateboard competition breathed new life into the Olympic program and Yuto Horigome was able to earn his place in history as the sport's first medalist, pulling off some spectacular tricks late in the competition to snatch gold.

Momiji Nishiya then stepped up and matched Horigome in the women's event, an incredible performance from a girl of 13, before Sakura Yosozumi made it three in the women's park days later.

Momiji Nishiya of Japan competes in the women's street skateboarding finals of the Tokyo Olympics at Ariake Urban Sports Park on July 26, 2021. The 13-year-old won the gold medal. (Kyodo) ==Kyodo

In all, Japan won five skateboarding medals. A Kanoa Igarashi silver and Amuro Tsuzuki bronze in surfing, three in karate and two by sport climbing's glamor girls Miho Nonaka and Akiyo Noguchi, made the new sports a happy hunting ground for the home nation.

Organizers' decision to push for the re-inclusion of men's baseball and women's softball paid off, with Japan defeating the United States in both gold medal games -- winning their first title in baseball and second in softball.

Japanese players celebrate after winning the gold medal game of the Tokyo Olympic baseball tournament against the United States on Aug. 7, 2021, at Yokohama baseball stadium. (Kyodo) ==Kyodo

Japanese pitcher Yukiko Ueno (C) celebrates with teammates after a 2-0 win over the United States in the gold medal game of the Tokyo Olympic softball tournament on July 27, 2021, at Yokohama baseball stadium near Tokyo. (Kyodo) ==Kyodo

In the pool, there were some high highs and some low lows.

Yui Ohashi was an unexpected winner of two individual medley golds, 200 and 400-meter, Japan's only two swimming titles. Big-name favorite Daiya Seto failed to make a splash, making only one final in three events when he was expected to win at least two medals.

After beating leukemia, Rikako Ikee made three appearances in relay races, but only made the final in one, giving her something more to shoot for in Paris in 2024.

Yui Ohashi of Japan reacts after winning the women's 200-meter individual medley event at the Tokyo Olympics on July 28, 2021, at Tokyo Aquatics Centre. (Kyodo) ==Kyodo

Japanese swimmer Rikako Ikee reacts after competing in the women's 4x100-meter medley relay final at the Tokyo Olympics on Aug. 1, 2021, at Tokyo Aquatics Centre. Ikee returned to competitive swimming in August 2020 after being diagnosed with leukemia in February 2019. (Kyodo) ==Kyodo

More so than in karate, Japan's supremacy in judo and wrestling was reinforced yet again. Nine judoka won Olympic titles, seven more than France and Kosovo, and the country claimed five gold, more than any other nation, in wrestling.

Japan also made some inroads into China's long-time table tennis hegemony, the host nation winning its first-ever gold in the sport thanks to Mima Ito and Jun Mizutani.

The mixed doubles pairing shocked Xu Xin and Liu Shiwen in a seven-game thriller, with Ito collecting three medals, one of each color.

Japan's Jun Mizutani (R) and Mima Ito react after winning the table tennis mixed doubles final against China's Xu Xin and Liu Shiwen at the Tokyo Olympics on July 26, 2021, at Tokyo Metropolitan Gymnasium. (Kyodo) ==Kyodo

As Japan looks to the future with its new generation of table tennis players, it can do the same in gymnastics.

Daiki Hashimoto settled nicely into "King" Kohei Uchimura's vacant throne, the 20-year-old taking men's all-around gold to ensure the title stays in Japanese hands for the third straight games. He then stepped up to the horizontal bar and gripped his second gold of the games.

This composite photo shows Japanese gymnast Daiki Hashimoto competing on the horizontal bar in the men's artistic gymnastics individual all-around final at the Tokyo Olympics on July 28, 2021, at Ariake Gymnastics Centre in Tokyo. (Kyodo) ==Kyodo

It was not all good news for Japan, though.

After taking center stage as opening ceremony Olympic cauldron lighter, Naomi Osaka then flamed out of the women's tennis singles' third round. A gold favorite of comparable fame in his sport, badminton world No. 1 Kento Momota, also lasted just two games in the singles group phase.

Japan's Naomi Osaka plays against Marketa Vondrousova of the Czech Republic in the third round of the Tokyo Olympic women's singles tournament at Ariake Tennis Park on July 27, 2021. (Kyodo) ==Kyodo

Japan's Kento Momota competes against South Korea's Heo Kwang Hee in a Tokyo Olympics men's badminton singles group play stage match at Musashino Forest Sport Plaza in Tokyo on July 28, 2021. (Kyodo) ==Kyodo

Although not quite at the stature of Osaka and Momota, world No. 4 table tennis player Tomokazu Harimoto had his singles tournament ended early, too. He made amends, however, by being the driving force behind Japan's team bronze.

When Japan was not in contention, other athletes had the opportunity to step into the spotlight.

Elaine Thompson-Herah filled a Usain Bolt-shaped hole in Jamaica's sprint team, winning the women's 100, 200, 4x100 sprint triple, a feat he made so iconic. In the individual events, she defended her 2016 Olympic titles.

Norwegian hurdle sensation Karsten Warholm smashed his own world record over 400 as did American Sydney McLaughlin over 400 flat. To round off the new bests, a pink-haired Yulimar Rojas added 0.17 of a meter to the women's triple jump world mark.

Alyson Felix won two medals to become the most successful female in Olympic athletics history, taking her total to 11 medals -- the most ever -- and seven gold as she runs into retirement.

Jamaica's Elaine Thompson-Herah reacts as she wins the women's 200-meter final at the Tokyo Olympics on Aug. 3, 2021, at the National Stadium. (Kyodo) ==Kyodo

Karsten Warholm of Norway competes in the men's 400-meter hurdles final at the Tokyo Olympics on Aug. 3, 2021, en route to winning gold in world record time at the National Stadium in Tokyo. (Kyodo) ==Kyodo

(From L) Allyson Felix, Athing Mu, Dalilah Muhammad and Sydney McLaughlin celebrate with the American flag after winning the women's 4x400-meter final of the Tokyo Olympics on Aug. 7, 2021, at the National Stadium. (Kyodo)

The games also featured a rare winter-summer Olympic medalist as American Eddy Alvarez won his second Olympic silver, adding to his 2014 Sochi Winter Olympic medal in the short track 5,000 meter relay.

Playoffs upped the ante of the golf tournaments.

In the men's competition, seven players went at it to see who would emerge with bronze, Taiwan's C.T. Pan overcoming some big-name competition -- including major winners Hideki Matsuyama, Collin Morikawa and McIlroy -- to win the right to stand on the podium's third step.

Mone Inami of Japan relegated Kiwi Lydia Ko to bronze in a women's second-place playoff, needing just one hole to do the deed.

Mone Inami of Japan hits off the second tee during the final round of the Tokyo Olympic women's golf tournament on Aug. 7, 2021, at Kasumigaseki Country Club in Kawagoe, Saitama Prefecture, near Tokyo. (Kyodo) ==Kyodo

The Americans maintained their place as the world's basketball leaders, but the gap is ever closing. They won both golds, with France taking men's silver and Australia winning its first men's medal in the sport with bronze.

In women's basketball, Japan made an epic run to the silver medal, by far the nation's best result in the sport.

Japan's final day basketball silver, along with Yumi Kajihara's first women's medal for the country in track cycling, cemented its place in third on the medal table, the highest it has finished since it ranked in the same place in 1968.

Japan may look back on the Tokyo Olympics with regret for many reasons, but the performance of its athletes will not be one.