BEIJING (AP) — Sui Wenjing and Han Cong exploded from their seats in the kiss-and-cry area, and a small and carefully chosen crowd of Chinese fans in the stands did the same, the moment their scores were read in the pairs event at the Beijing Olympics.

Four years after a crushing disappointment at the Pyeongchang Games, when they lost the gold medal by the thinnest of margins, Sui and Han had flipped the script: They were the ones walking away as champions by a razor-thin margin.

Sui and Han scored a world-record 239.88 points with a flawless free skate set to a rendition of “Bridge Over Troubled Water,” beating Russian rivals Evgenia Tarasova and Vladimir Morozov by just 63 hundredths of a point.

“We went through a lot, from being not expected (to do well) at the very beginning,” said Sui, who along with Han missed out on gold by 43 hundredths of a point in Pyeongchang. “So today, we have really put out our best on the rink.”

The difference in gold may have come down to Sui and Han opening with a quad twist, a high-scoring element that made up for a sloppy triple salchow and kept them from losing their lead of 16 hundredths of a point after the short program.

“We just did what we did before. It wasn’t particularly difficult. We just skated our program as we trained,” Morozov said. “We didn’t feel much stress. We feel like we skated as one, so it went pretty smooth for us.”

Tarasova and Morozov, coached in part by the polarizing Eteri Tutberidze, finished with 239.25 points to claim the silver medal while teammates Anastasia Mishina and Aleksandr Galliamov, the reigning world champions, scored 237.71 to earn the bronze medal and cap a strong — and controversial — Winter Games for the Russians.

“When we skated the program and all the elements went well,” Mishina said, “there was this familiar feeling that if we do everything — if we do well — we are going to win. Here, we understood that maybe it will not work this way, and we were just happy with the fact that we managed to do everything well.”

The Russian team won two of the five figure skating gold medals and six medals in all, though the total could change in the future because the nation also dominated the Olympic news cycle with another doping scandal.

One of the gold medals currently belongs to Kamila Valieva and her teammates, who handily won the team event to start the Beijing program. But that medal was being withheld after a positive pre-Olympic drug test from Valieva, who finished fourth in the women’s event, came to light during the first week of the Winter Games.

The International Olympic Committee has refused to award the medals, worried that a full doping investigation could result in their eventual redistribution. But the U.S. team filed an appeal to the Court of Arbitration for Sport on Saturday to have a medal ceremony before Sunday’s closing ceremony; the Americans took silver and Japan earned bronze in the event.

That meant the American pair of Alexa Knierim and Brandon Frazier, and Japanese rivals Riku Miura and Ryuichi Kihara, performed their free skates Saturday still unsure of when they would receive their team medals.

It didn’t look as if they were too worried about it.

Miura and Kihara were nearly flawless in their free skate to “Woman” by Shawn Phillips, leaping from ninth after their short program and briefly into first place. Knierim and Frazier made only one mistake, on their triple salchows, and a season-best 138.45 for their short program briefly sent them into the lead.

It wasn’t enough for either team to land on the podium, but it was an uplifting way to finish the Olympics.

“It’s crazy. It’s nuts,” Frazier said. “It was a true dream come true — it was our true selves out there. We didn’t let our nerves get the best of us. Made one technical error on the jump on my part. Everything else we did was solid.”