Japan took gold on 259.594 points, a little more than half a point ahead of China. The United States got bronze.
Team China led by more than three points heading into the final round, with Xiao Ruoteng, Su Weide and Zhang Boheng up on the horizontal bar.
But Su slipped and lost his grip on the bar twice in his routine, for a subpar score of 11.6. Zhang was unable to make up for the deficit in the last routine.
Team China had taken the lead after the first three rotations, with exceptional performances on the rings, led by Tokyo Olympic gold medallist Liu Yang, and strong scores on the horse.
Zou Jingyuan and Zhang then extended the advantage with slick moves on the parallel bars, with Zou getting 16 points on the apparatus, the highest individual score in the entire event.
But Su had a night to forget as his slips also meant the chance at gold faded away.
The Japanese themselves had to overcome a poor start to the competition to capture gold in the end.
Team China snatched bronzes in the same event at both the Tokyo and Rio Olympics.