And finally, more than four hours after the first pitch was thrown, Samurai Japan broke through.

Hirokazu Ibata hit a game-tying RBI single in the top of the ninth, Sho Nakata drove in the tie-breaking run with a sacrifice fly in the 10th and Japan rallied to defeat Chinese Taipei, 4-3, in the second round of the World Baseball Classic on Friday at Tokyo Dome in a thrilling game that lasted four hours and 37 minutes.

"All of the Japanese fans are showing their appreciation for Ibata, and so am I," Japan manager Koji Yamamoto said. "Nakata, such a young player, he had a game-winning sacrifice fly, and it was good enough."

Japan will have a chance to punch its ticket for the Championship Round at San Francisco's AT&T Park with a win over the Kingdom of the Netherlands on Sunday. The Dutch defeated Cuba, 6-2, earlier Friday.

Chinese Taipei has to face Cuba for the right to continue in the Classic on Saturday. Chinese Taipei will send Ching-Lung Lo to the mound against Cuba's Danny Betancourt.

Chinese Taipei was cruising with a 2-0 lead for much of the night before Japan staged an eighth-inning rally reminiscent of the one it used to beat Brazil in its opening Classic game.

Yomiuri Giants (Nippon Professional Baseball) duo Shinnosuke Abe and Hayato Sakamoto delivered RBI singles in their home park to tie the score at 2 in the eighth.

Chinese Taipei snatched the lead back in the bottom half of the inning, with a single, double and an RBI single by Szu-Chi Chou off pitcher Masahiro Tanaka.

Chinese Taipei's Hung-Wen Chen retired Atsunori Inaba, walked Takashi Toritani, then retired Hisayoshi Chono to start the ninth. Toritani was nearly caught stealing second with Ibata at the plate, but just beat the throw from the catcher.

Ibata worked the count even at 2-2, then delivered an RBI single that tied the score.

"I don't really remember," Ibata said of the hit. "But overall, I was kind of relaxed. The result is, I got a base hit, and I'm happy I got a hit."

After Nakata's heroics in the top of the 10th, Chinese Taipei put runners on first and second with one out in the bottom half, but it couldn't seal the deal against reliever Toshiya Sugiuchi.

"First of all, my players played very well, and I can't thank everyone enough," Chinese Taipei manager Chang-Heng Hseieh said through a translator. "In such an international game in such an international competition, I am always eager to play well, so we can get closer to Japan. Although we lost, we put a lot of pressure on Japan."

Japan's Kazuhisa Makita threw a scoreless inning to earn the win in relief. Chen was charged with the loss, and Sugiuchi earned the save.

Japan's rally in the eighth wiped out another fantastic outing by Taiwanese starter Chien-Ming Wang, who threw six shutout frames to extend his Classic scoreless streak to 12 innings. Wang allowed six hits, walked one and struck out one.

"He went six innings without any runs," Hseieh said. "I can't complain. It's the best result. Unfortunately we couldn't beat Japan, but all the players played as hard as they could."

Jason Coskrey is a contributor to MLB.com. This story was not subject to the approval of Major League Baseball or its clubs.