Vicente del Bosque's world champions will face Italy in the last four on Thursday evening in a repeat of last year's European Championship final which Spain won 4-0 while Uruguay are also through as runners up in Group B after they clubbed Tahiti 8-0 in the night's other match.
They will meet host nation Brazil in an all-South American semi-final on Wednesday night.
Jordi Alba danced through a posse of white shirts to slide the ball into the net for the opening goal on three minutes before substitute Torres nodded home the second from Pedro's cross on 62 minutes.
Alba added the third goal on the break for Spain with two minutes remaining as he bounded onto David Villa's free-kick before rounding goalkeeper Vincent Enyeama to secure Spain three wins out of three after a 2-1 win over Uruguay and a 10-0 drubbing of Tahiti's part-timers.
Torres has now scored five goals from six shots on target in the 2013 Confederations Cup, and is showing flashes of his old form at these finals.
Spain progress as group winners on nine points. Uruguay join them on six with Nigeria's 6-1 win over Tahiti their solitary success last weekend.
Spain were probably fortunate to escape this match without conceding a goal as Nigeria contrived to pass up several chances to cut through an opposition side who are now 25 matches unbeaten in international climes.
John Obi Mikel saw a shot deflected over the bar by Gerard Pique on 11 minutes with Victor Valdes diving to swat a Sunday Mba effort past a post eight minutes later.
Joseph Akpala headed straight at Valdes from Efe Ambrose's cross with Jospeh Ideye narrowly failing to convert an Ambrose cutback seven minutes before half-time.
The chances continued to come and go for the African champions in the second period with Ideye failing to finish on 52 minutes after Valdes failed to hold Ahmed Musaab's cross.
Mohammed Gambo perhaps wasted Nigeria's best chance on 73 minutes when he mishit a volley wide after being played in by the dangerous Musaab, who had ghosted beyond Sergio Ramos like he was invisible.
Of course, Spain also had plenty of moments of their own with Cesc Fabregas hitting a post in the first half and Ramos nodding straight into the arms of Enyeama seconds before the break.
Enyeama also had to look likely to save from Roberto Soldado while Silva failed to direct a volley at goal after being played in by a crisp Andres Iniesta ball. In the end, none of it mattered as Spain progressed with a bit to spare.
MAN OF THE MATCH
Jordi Alba - Less a left-back, more an extra winger. Couple of lovely goals by the Barcelona player in a fine all-round performance.
Nigeria: Enyeama 6, Oboabona 6, Echiejile 6, Ambrose 6, Omeruo 5, Mikel 6, Ogude 6, Mba 7, Musa 7, Ideye 6, Akpala 6...subs: Ogu 6, Egwueke 6, Gambo 6
Spain: Valdes 7, Arbeloa 7, Sergio Ramos 7, Pique 7, Jordi Alba 8, Xavi 8, Busquets 7, Iniesta 8, Pedro 7, Fabregas 7, Soldado 7..subs: Villa 7, Torres 7, Silva
- Sports & Recreation
- Jordi Alba
- Victor Valdes