Tetsuto Yamada's three-run double with two outs in the bottom of the eighth was the difference Wednesday as Japan advanced to the Olympic baseball gold medal game with a 5-2 win over South Korea.

Japan nearly went through the eighth quietly. With one out and one man on base, Japan's Kensuke Kondoh hit a grounder that South Korea couldn't quite turn into a double play. The play was reviewed to see if Kensuke had veered from the base path, but the play was upheld. 

South Korea then intentionally walked Munetaka Murakami, then unintentionally walked Takuya Kai to load the bases for Yamada.

In the ninth, South Korea got a runner to second but could manage nothing else against reliever Ryoji Kuribayashi.  

Japan scored its first run with two sacrifices in the third inning. Yamada bunted to advance Murakami and Takuya to third and second after each player singled. Hayato Sakamoto drove in Murakami with a sacrifice fly.

Yamada was also involved in the second Japanese run, starting the fifth inning with a double and scoring on a single by Masataka Yoshida .

South Korea tied the game in the sixth on RBI singles by Kang Baek-ho and Kim Hyun-soo.

On Thursday, South Korea will play the United States, with the winner advancing to play Japan for gold and the loser playing the Dominican Republic for bronze. Both medal games will be on Saturday.