Forward Ramandeep Singh turned out to be the hero with two goals in the 50th and 51st minute.
Drag-flicker Rupinder Pal Singh (24th minute) and Akashdeep Singh (45th) were the other scorers for the Sardar Singh’s team.
Ricardo Santana (25th minute) and Xavier Lleonart (49th) accounted for Spain’s goals.
The first quarter started on a brisk note as both teams competed to dominate early in the game.
After a barrage of attacks in the opening minutes, Spain earned a penalty-corner but an alert P R Sreejesh, in the Indian goal, averted danger. After an intense tussle, the quarter ended goalless.
India went ahead in the 24th minute (second quarter) when drag-flicker Rupinder Pal Singh successfully converted a penalty-corner.
The home side hit back in the next minute. Ricardo Santana dribbled past the India defenders and scored to take his team into the third quarter tied 1-1.
In the third quarter, Sreejesh again denied Spain the lead with a brilliant save off a penalty-corner before Akashdeep Singh sneaked into the Spanish circle and slotted the ball home in the 45th minute.
Spain equalised in the 49th minute with a field goal from Xavier Lleonart.
After conceding the goal the Indians pressurized the Spain citadel and were rewarded when Ramandeep scored in the 50th minute and added another in the next to complete the rout.
Image: Ramandeep Singh
Photograph: Hockey India
Europe hockey tour: India score over Spain
1st Hockey Test: Clinical India blank France
Indian hockey team to embark on Euro tour under Oltmans
India pay for defensive lapses as Britain secure bronze
Gurbaj suspended for 9 months for 'disciplinary issues'