Spain will face Italy in the Confederations Cup semi-finals after they beat Nigeria to top Group B.
Jordi Alba scored twice, stroking in following a flowing move early on and then rounding Nigerian goalkeeper Vincent Enyeama with two minutes left.
Nigeria caused problems for Spain’s defence in between with John Mikel Obi and Sunday Mba going close.
Fernando Torres headed in two minutes after coming on as a substitute, before Alba sealed it to knock Nigeria out.
The goal from Chelsea striker Torres took the heat out of the contest, but despite Spain’s superiority in possession, Nigeria were let down again by poor finishing when substitute Gambo Muhammad squirmed the ball wide with 15 minutes left.