The reigning European champions suffered a 2-1 defeat at the hands of South American giants Brazil in their opening encounter last Saturday, but recovered swiftly to open their account in the tournament.
Spain was up 1-0 when Abel Ruiz's tap-in found the back of the net in the 21st minute. Ruiz was at the right place and easily converted Juan Miranda's cross from the left flank, leaving the Nigerian defence napping.
Spain doubled the lead just before the half time, and again it was Ruiz, who was in the thick of things as the Barcelona youth player scored off a Sergio Gomez free-kick in the 41st minute.
Niger's agony did not end there as Spain added one more goal in the first-half injury time through Cesar. Ruiz's attempt was palmed away by the goalkeeper and Gomez sent in a curling cross towards the ball and even before the keeper could make a clearance, Cesar placed it in the roof of the net.
Gomez's strike completed a rout that put Spain firmly in contention for a knockout berth from the group.
Debutants Niger, last Saturday, defeated North Korea 1-0 to register their maiden FIFA World Cup win in their maiden appearance.