Kohei Uchimura completed his collection of gymnastics titles on Monday by leading Japan to men's Olympics team gold, with Russia returning to the podium for the first time since 2000 to take silver.
But two-time reigning champions China were restricted to bronze in a thrilling final which went down to the wire at the Rio Olympic Arena.
The 27-year-old Uchimura had already won all-around gold in London 2012 and 10 world medals including six consecutive individual titles.
But despite his individual accolades the gymnast known as "King Kohei" had taken just two silver in the Olympic team event behind China in 2008 and 2012.
"We put in a lot of effort to come this far. This was the event in which I wanted to win gold," Uchimura said of his sixth Games medal, with the possibility of two more in the all-around and on floor to come.
China were devastated by the loss of a title which represents everything to the country, after losing their world crown last year to Japan.
Team leader Zhang Chenglong, the only member of the 2012 gold-medal winning team, paid tribute to their rivals.
"We have to be happy for Japan because every athlete wants to be the best," said 27-year-old Zhang.
"Team gold is the most important and precious for us Chinese because everyone has to be excellent. You have to be solid and united."
Victory put Japan back on top of the podium for the first time since 2004 with a seventh gold in an event the country dominated through five Olympic Games in the 1960s and 1970s.
But they had to battle a determinated Russia, who they competed alongside and had led for the first four rotations, with Denis Abliazin outscoring Olympic champion Arthur Zanetti of Brazil on the rings.
The five-man Japanese team, which also included Koji Yamamuro, Ryohei Kato, Yusuke Tanaka and Kenzo Shirai, pulled ahead on horizontal bar to lead by just 0.208 going into their final floor rotation.
World floor champion Shirai set Japan on their way with a soaring 16.133. Competing last Uchimura scored 15.600 to seal the title.
"It was tough. My first emotion was that I was just exhausted," said a visibly tired Uchimura.
Russia were delighted just to be back on the podium.
"Silver is more important for us right now than gold," said Russia's Ivan Stretovich.
"Russia hasn't won (a team medal) in the Olympic Games for 16 years. We are really excited that we did it."
Japan scored 274.094 after the six rotations with Russia, who led early, finishing on 271.453 and China 271.122.
"It's not too much to say that it was the worst day for my heart," said and emotional Shirai.
"But there is no doubt it became the happiest day ever."
Uchimura started on the pommel horse, clinching his fist to the crowd after competing, although team-mate Yamamuro fell off the apparatus.
He was controlled on rings and nailed his vault despite a little hop back on landing with Shirai scoring 15.633.
China paid for errors starting with a shaky start for Lin Chaopan and Deng Yang on the floor, with You Hao struggling on his rings dismount.
China impressed on the parallel bar, on which You Hao scored 16.166, and needed a strong final rotation on the high bar, but failed to produce the needed fireworks.
It was another blow for the Chinese, whose 12-year reign as world champions ended last October when Uchimura helped Japan to gold for the first time in 37 years.
Britain finished two points off bronze, in fourth ahead of the United States, who had been second in qualifying.
Hosts Brazil were sixth ahead of Germany and Ukraine respectively in the eight-team final.