Spain will face Brazil in the Olympics Men's football final after penalty and extra time drama in the semi-finals.
La Roja booked their spot in the showpiece event by beating tournament hosts Japan 1-0 on Tuesday.
Marco Asensio scored the only goal of the game in extra time to set up a final meeting with Brazil at the International Yokohama Stadium this weekend.
Japan gave a great account of themselves in their last-four clash with Spain, sticking to a disciplined defensive shape while looking for opportunities to hit their opponents on the break.
La Roja were denied a penalty after a VAR review, but neither side really looked like breaking the deadlock in the first 90 minutes, and extra time was needed to find a victor.
Asensio proved to be the matchwinner in the 116th minute, picking the ball up in the box before curling a beautiful strike into the far corner of the net.