Japan's bid for a second straight appearance in the team table tennis men's final at the Olympics ended Wednesday night after a 3-2 defeat to German in the semifinals at the Tokyo Games.

Jun Mizutani, Koki Niwa and Tomokazu Harimoto lost to Timo Boll, Patrick Franziska and Dimitrij Ovtcharov in a seesaw match, missing out on what would have been a rematch of the 2016 Rio de Janeiro Olympic final against China on Friday.

Japan's Tomokazu Harimoto (facing camera) reacts after winning a point during a semifinal match of the men's table tennis team event against Germany at the Tokyo Olympics on Aug. 4, 2021, at Tokyo Metropolitan Gymnasium. (Kyodo)

Germany instead will take on the Chinese, who swept past South Korea 3-0 in the day's first semifinal and will be heavily favored to defend their title, having won all three gold medals since the team event was introduced at the 2008 Beijing Games.

Japan takes on South Korea in the bronze medal match, also on Friday.

Mizutani and Niwa, who were on Japan's silver-medal winning team in Rio, came from two games down only to lose 11-2, 11-3, 9-11, 8-11, 11-7 in their opening doubles against 40-year-old veteran Boll and Franziska.

"Not being able to win the final game (in the doubles) cost us dearly," said Niwa. "We have got the day off tomorrow to try to regroup."

World No. 4 Harimoto put Japan on level terms, rallying for a 7-11, 13-11, 11-5, 11-9 win over Ovtcharov but Boll restored Germany's advantage by downing Mizutani 7-11, 13-11, 11-7, 11-7.

Harimoto once again dug in deep to give Japan hope, rebounding for a 5-11, 9-11, 11-5, 11-9, 11-9 win over Franziska to set up a tense finale.

In the decisive match, Niwa was presented with the chance to avenge his 4-1 defeat to Ovtcharov in the singles round of 16, but it was not to be as the German won 11-9, 11-7, 11-8 to seal victory.

"Whether we laugh or cry the next match is our last and we will try and put everything out there," said Mizutani.

Japan's women's team of Mima Ito, Kasumi Ishikawa and Miu Hirano play China in the women's team final on Thursday.