Reigning Olympic men's football champions Brazil sealed a return to the final as they defeated Mexico 4-1 on penalties Tuesday following a goalless draw after 120 minutes in Kashima.
Brazil goalkeeper Santos saved from Eduardo Aguirre in the shootout before Johan Vasquez smacked the post with Mexico's second attempt.
Dani Alves, Gabriel Martinelli, Bruno Guimaraes and Reinier all scored for Brazil, who await either Spain or hosts Japan in Saturday's final in Yokohama.
Mexico, the 2012 gold medallists, had scored 14 goals in four matches in this year's tournament -- including six in their quarter-final win over South Korea.
Their best period against a disciplined Brazil came at the end of the first half as Luis Romo forced an excellent save from Santos, with Uriel Antuna's goalbound effort then blocked by Diego Carlos.
Everton forward Richarlison, the competition's top scorer with five goals, nearly won the game for Brazil just before the end of normal time but his glancing header bounced back off the post.
Japan, who beat New Zealand on penalties in the quarter-finals, are making their seventh consecutive appearance in the men's tournament at the Olympic Games.
Spain won gold at the 1992 Games in Barcelona. They needed a last-gasp equaliser against Ivory Coast in the previous round before prevailing 5-2 after extra time.