Brazil defeated Spain in a penalty shootout Sunday to reach the semifinals of the Under-20 World Cup and a matchup with Mexico.

Wednesday's other semifinal will pit France against Portugal, after the French defeated Nigeria 3-2 earlier Sunday in extra time.

Brazil won the shootout 4-2 after the match was level at 1-1 after regulation time and 2-2 after 30 minutes of extra time.

Willian gave Brazil the lead in the 35th, before Rodrigo - who was born in Brazil - equalized for Spain in the 57th. Brazil went ahead with Dudu's goal in extra time, but Spain answered two minutes later thanks to Alvaro Vazquez.

Vazquez is the tournament's leading goal scorer with five.

Almost everyone is regarding this match as the ''real final'' with the two best teams in the tournament thrilling the crowd with end-to-end football, possession passing and counterattacking to keep the other side off balance.

Spain, trying to match the title of its senior team last year in South Africa, rallied twice before losing on penalties.

First to take its kick, Spain fell behind when its first penalty-taker, Jordi Amat, was stopped by a diving Brazil keeper Gabriel. Vazquez also missed Spain's fourth penalty when Gabriel kicked the shot away.

In the meantime, Brazil converted its four from Casemiro, Henrique, Danilo and Dudu.

Brazil has won the Under-20 title four times and was runner-up two years ago to Ghana in Egypt. Only Argentina has won more titles with six.

Brazil will be the favorite if it reaches Saturday's final in Bogota.

With rain pouring down in the first half, Brazil opened the scoring against the run of play after Spain had most of the early possession. Breaking on a counterattack, Henrique hit the crossbar, but the ball bounced straight to Willian who tapped it home.

Spain equalized when Rodrigo headed in a perfect cross from the right side by Hugo Mallo. The goal came as the rain let up and as Spain settled back into its possession game after looking rattled by the early goal.

Both teams had chances to win in regulation, but they both seemed to wear down as extra time approached.

Brazil went in extra time when Henrique sent a pass to Dudu who drilled it home from 15 meters (yards).

Spain responded immediately when second-half substitute Vazquez chipping in a perfect pass from Carles Planas.