The curtain was drawn on the Beijing Games on Sunday night with Japan having discovered a new set of stars, celebrated some familiar faces and perhaps seen one of its all-time greats on Olympic ice for the last time.

The ceremony was held at the National Stadium, the venue also known as the "Bird's Nest," to mark the end of the games that began on Feb. 4.

The closing ceremony continued the storyline from the opening, telling the "Story of a Snowflake" inspired by a poem written 1,300 years ago by Chinese poet Li Bai. The snowflake motif used as the cauldron was also featured on lanterns held by dancing children.

Children take part in the closing ceremony of the Beijing Winter Olympics at the National Stadium on Feb. 20, 2022. (Kyodo) ==Kyodo

Among the Japanese contingent at the ceremony was the silver medal-winning women's curling team led by skip Satsuki Fujisawa. Speed skater Arisa Go carried the national flag.

International Olympic Committee President Thomas Bach praised the athletes for showing a spirit of solidarity and peace as he declared the end of the games.

"We share this Olympic spirit with all the athletes who, because of the pandemic, could not make their dream come true," he said. "But you belong and you will always belong to the Olympic community."

Chinese President Xi Jinping (C) stands next to International Olympic Committee President Thomas Bach (L) during the closing ceremony of the Beijing Winter Olympics at the National Stadium on Feb. 20, 2022. (Kyodo) ==Kyodo

The Olympic flame, burning in a torch carried by the giant snowflake, slowly faded to symbolize the end of the games.

The ceremony was wrapped up by dazzling fireworks that lasted 90 seconds as the Bird's Nest, far less crowded than during the 2008 Beijing Summer Games closing ceremony due to anti-coronavirus measures, said farewell to a sometimes drama-filled Olympics.

Fireworks light up the sky over the National Stadium at the end of the closing ceremony of the Beijing Winter Olympics on Feb. 20, 2022. (Kyodo) ==Kyodo

Athletes gather during the closing ceremony of the Beijing Winter Olympics at the National Stadium on Feb. 20, 2022. (Kyodo) ==Kyodo

Headlines across the world were dominated by the sad situation of 15-year-old Russian figure skater Kamila Valieva, who was revealed to have failed a pre-games doping check, won a gold medal that may not stand, and then melted down in the moment she was expected to shine the brightest.

Questions around China's hosting of the games amid criticism of its human rights record faded into the background until an organizing committee spokesperson made comments that brought a rebuke from the IOC, an own goal far from the ice hockey stadium.

Japan's 18 medals are more than it has won at any other Winter Games, five more than the high water mark from four years ago. The final tally was three gold, six silver and nine bronze.

Arisa Go (C) bears the Japanese flag at the closing ceremony of the Beijing Winter Olympics on Feb. 20, 2022, at the National Stadium. (Kyodo) ==Kyodo

Japan won an Olympic gold medal in snowboarding for the first time thanks to halfpipe hero Ayumu Hirano while speed skater Miho Takagi now has won more medals than any other Japanese Winter Olympian after taking her medal total to seven, adding one gold and three silvers at the Chinese capital's "Ice Ribbon."

The nation's other gold medal came in ski jumping when Ryoyu Kobayashi dominated the normal hill to beat all comers for his first Olympic title.

Perhaps the biggest story for Japan came from a man who won no medal at all -- figure skater Yuzuru Hanyu.

Coming into the games with a third straight men's title in the offing, Hanyu had a bad start in his short program thanks to an unfortunate encounter with a hole in the ice. His fortunes worsened when he hurt his ankle while practicing for the free skate.

Yuzuru Hanyu of Japan competes in the men's figure skating free skate at the Beijing Winter Olympics on Feb. 10, 2022, at the Capital Indoor Stadium in Beijing. (Kyodo) ==Kyodo

Then, his medal hopes slipped away for good when he fell multiple times during the free program in what could be his final appearance at an Olympics.

He declared his reign as "king of the Olympics" over but assured his fans he still has more to give in the chase for perfection and the elusive quad axel.

American Nathan Chen replaced Hanyu atop the pile and Japan's Yuma Kagiyama joined him one step below, taking silver on his Olympic debut at just 18 years of age, with teammate Shoma Uno in third.

Related coverage:

Olympics: Chen wins figure skating gold, Kagiyama silver, Uno bronze

The Beijing Olympics are the fourth straight in which Japan has won at least one men's figure skating medal and the second straight that it has won two.

When Kaori Sakamoto won women's bronze, to go with the provisional bronze she, Kagiyama, Uno and others won in the team event, the figure skating arena was proven a happy hunting ground for Japan.

With Kobayashi one of the games' dominant figures at the ski jumping hill, it was expected Japan could challenge for a team medal. But an equipment legality issue for Sara Takanashi dashed its chance, the hit coming just days after the jumper yet again failed to meet expectations in the women's event.

Hirano's win in the men's halfpipe was also not without complications.

Having landed a never-before-seen-at-the-Olympics triple cork in his near-perfect second run, Hirano was stunned to be given a score not commensurate with the risk he took, leaving him in second.

Angry and set on not letting the judges ruin his games, the dual Summer and Winter Olympian went even bigger on his third shot to give the scorers no option but to reward him with gold.

Related coverage:

Olympics: Ayumu Hirano wins men's snowboard gold for Japan

Takagi's Olympics was almost a story of what could have been, but at her last opportunity she secured a gold to go home with at least one title to show for her superhuman efforts.

Taking on a five-race program at the games, she collected three silvers -- including one that would have been gold had her sister not fallen with the team pursuit finish line in sight -- but got over the top in a 1,000-meter race in which she said she finally pulled all the right strings.

Nordic combined athlete Akito Watabe finished third in two events to win a medal at his third straight games, but gold continued to elude him, while at the other end of the scale 17-year-old debutante Kokomo Murase earned her first, a bronze, in the women's big air snowboarding.

The games were closed out with a valiant effort from Japan's women's curling team. They earned silver, the best medal ever won in curling by the country, when they were unable to overcome Great Britain in the final.

Related coverage:

Olympics: Speed skaters to turn stumbling blocks into stepping stones

Olympics: Japan takes silver in women's curling after loss to British

Combined photo shows Japanese medalists, (from top L) snowboarder Ayumu Hirano (1), speed skater Miho Takagi (2), ski jumper Ryoyu Kobayashi (3), figure skater Yuma Kagiyama (4), Loco Solare curling team (5), snowboarder Kokomo Murase (6), figure skater Shoma Uno (7), snowboarder Sena Tomita (8), figure skater Kaori Sakamoto (9), women's speed skating pursuit team (10), moguls skier Ikuma Horishima (11), Nordic combined athlete Akito Watabe (12), Nordic combined relay team (13), speed skater Wataru Morishige (14), and figure skating team (15). (Kyodo)