WEMBLEY, England -- Oribe Peralta scored with a swerving, long-range strike then set up another goal with a stunning back-heel to help Mexico beat Japan 3-1 on Tuesday and secure a spot in the final of the men's Olympic soccer tournament.

Mexico will play Brazil in the final on Saturday. The Brazilians defeated South Korea, 3-0, in Manchester to reach its first Olympic soccer final in 24 years.

"We are guaranteed a silver, but we want a gold," Mexico coach Fernando Luis Tena said. "Mexico is a football nation. They must be partying tonight."

Mexico's previous best showing at the Olympics was at the 1968 Mexico City Games, when the team was beaten in the bronze-medal match 2-0 by Japan, also that nation's best finish.

Yuki Otsu opened the scoring at the 12-minute mark for Japan. The forward sent a swerving shot into the roof of the net from outside the penalty area after several quick passes carved out a sliver of space.

Marco Fabian headed in a corner for Mexico before halftime to equalize.

Peralta scored at the 65-minute mark after winning the ball off of Japanese defender Takahiro Ohgihara, who lingered with it too long after keeper Shuichi Gonda had rolled it to him. Peralta ran with the ball briefly then shot high and to the left of Gonda to give Mexico the lead.

Deep into extra time, Javier Cortes cut into the box from the right wing, took the back-heel from Peralta, beat a defender, then sent the ball through the legs of Gonda to cap the victory.