PARIS (AP) — Japan surged past its longtime rival China to win gold in the Paris Olympics men’s gymnastics competition Monday, and the Americans earned bronze for their first medal since 2008.

It was Japan’s eighth team gold and first since Rio de Janeiro in 2016.

The Japanese overtook their rivals on the final rotation, after China’s Su Weide fell twice off the horizontal bar. Japan won with a small margin of 0.532 points.

After qualifying in fifth place, the U.S. men — which includes athletes Brody Malone, Frederick Richard, Stephen Nedoroscik, Asher Hong and Paul Juda — ended a 16-year drought to the delight of the dozens of fans waving American flags who chanted “USA, USA” throughout the evening.

The Americans posted a total of 257.793 points to edge Britain for the bronze.

Russia, which won gold at the Tokyo Games, did not compete because of its role in the war against Ukraine.

The Chinese had dominated qualifying ahead of Japan, the reigning world champion.

They faced off in the same group, starting their competition on floor exercise. China looked set for its first gold medal in the competition since 2012 after taking the lead midway through the competition.

But Takaaki Sugino, Shinnosuke Oka and Tokyo Olympics all-around champion Daiki Hashimoto nailed Japan’s comeback with excellent displays on the horizontal bar while Sue faltered.