Brazil scored three second-half goals to defeat Saudi Arabia 3-0 on Wednesday and advance to the quarterfinals of the Under-20 World Cup.

Striker Henrique put Brazil on the board after a counterattack in the 46th minute, Gabriel Silva added to the lead with a shot from inside the area in the 69th and substitute Dudu sealed the victory from close range in the 86th.

The victory sends the four-time champions into a quarterfinal against powerhouse Spain, which earlier Wednesday advanced by edging South Korea on penalties.

After Brazil struggled to get past the Saudi Arabia defense in the first half, Henrique quickly put Brazil ahead in the second period.

Midfielder Fernando started the play with a pass to striker Willian, who deflected the ball toward Henrique, and the striker directed a well-placed shot past onrushing goalkeeper Abdullah Alsdairy, with the ball going in off a post.

Willian also was involved in the second goal, making a run on the left after a pass by fullback Danilo. He cleared a defender inside the area and the ball ended with Gabriel Silva, who had an easy shot into the far corner.

Dudu, who came on in the 61st after Henrique suffered an arm injury, completed the scoring with a low cross shot inside the far post after another nice through-ball by Danilo.

Brazil began the match making too many passing mistakes and it was Nigeria which threatened early in front of more than 35,000 fans at the packed Metropolitano stadium in Barranquilla.

Striker Fhad Almuwallad broke through the Brazilian defense and shot just wide less than a minute into the match.

Henrique had Brazil's first significant chance with a long-range shot that forced Alsdairy to make a save in the 18th.

Brazil appealed for a penalty in the 20th when Oscar used a nifty move to get past two defenders and was apparently brought down by a sliding tackle inside the area.

Saudi Arabia midfielder Abdullah Otayf had a shot from outside the area saved by Brazil goalkeeper Gabriel in the 34th, and Almuwallad also threatened from long range in the 45th.

The Saudis were not able to keep pressuring Brazil after allowing Henrique's goal and it was Brazil who had most of the scoring opportunities until the end.

Brazil welcomed back defender Juan, who was suspended for the previous game due to yellow-card accumulation.

Brazil is playing the tournament without top stars Neymar and Lucas, who played with the senior national team in the Copa America last month.

Saudi Arabia reached the competition's knockout stage for the first time.