Montreal:Adrian Lopez's first-half hat trick helped Spain defeat Jordan 4-2 and advance to the last 16 with first-timer Zambia at the Under-20 World Cup on Saturday.
Zambia upset Uruguay 2-0 in Victoria, British Columbia.
In Group F matches, Japan and Nigeria, already qualified for the second round, drew 0-0 in Victoria, and Costa Rica earned a consolation win over Scotland 2-1 in Burnaby.
European champion Spain won Group B with seven points, followed by Zambia and Uruguay with four each, and Jordan one. All but Jordan advanced.
Despite scoring three times, Lopez said he and his team must get better for a second-round opponent yet to be determined.
"I think I will have to improve and play better in the matches to come," Lopez said. "I am happy I scored three goals but most important is the victory."
Marcos Garcia provided insurance for Spain in the second half when he nodded in a ball chipped deep into the penalty area.
Loiy Al Zaideh and Abdallah Salim, with his second goal in three games, tallied early in the second half for Jordan, making its first appearance in the tournament.
An error by Uruguay goalkeeper Mauro Goicoechea allowed Zambia's Clifford Mulenga to score on a penalty kick 22 minutes in. Rodgers Kola doubled the lead in the 51st to put Zambia into the second round for the first time, where it will face fellow African side Nigeria next Thursday.
Japan, which secured first place in Group F by drawing Nigeria, benched eight starters for the game, while Nigeria rested four.
The high point in a sloppy game before a sellout crowd of 11,500 at Royal Athletic Park was when Japan scored in the 62nd minute after defender Shinji Kagawa buried the ball into the top of the net after spinning to beat his defender. But referee German Arredondo ruled Kagawa played the ball with his hand.
Japan will meet the Czech Republic on Wednesday.
Jonathan McDonald, whose name comes from the Highlands, scored in injury time to give Costa Rica the victory over Scotland.
Pablo Herrera tied the game in the second half after Mark Reynolds gave Scotland a 1-0 lead in the 18th minute.