Favourites India overcame a goal deficit to edge out Spain 2-1 thereby sealing a semi-final spot in the men's Junior Hockey World Cup.
The hosts will meet Australia in the semi-final tomorrow.
It was a far from impressive performance by the Indians, who are touted as title contenders as they fumbled in almost all departments of the game.
A packed Major Dhyan Chand Stadium stadium heaved a sigh of relief when Simranjeet Singh (57th) equalised for India after Marc Serrahima gave Spain the lead in the 22nd minute.
The Indians earned as many as nine penalty corners but could utilise just two with Harmanpreet converting the hosts' eighth set piece in the 66th minute to clinch a last four berth.
By virtue of this win, the Indian colts not only continued their domination over Spain but also managed to avenge their loss against the same opponents in the bronze medal match of the 2005 edition of the World Cup in Rotterdam.
Even though they enjoyed their share of ball possession, Indians looked completely off-colour in the opening half.
There was a distinct lack of co-ordination. There were sloppy mistakes while trapping and releasing the ball during the first half.
The Indian colts though created more openings but Spain utilised the lone opportunity thet got in the first half.
Spain came out with a tight defensive structure and relied on man marking to stop the attacking Indians.
They took the lead in the 22nd minute through Serrahima's penalty corner conversion much to the stunned silence of the partisan crowd.
Three minutes later Mandeep Singh's deflection from Santa Singh's cross found the back of the Spanish net but it was disallowed by the umpire because of raising ball to go into the breather trailing by a goal.
After the change of ends, the Indians went all out attacking in search of goals but fauiled to make any headway, courtesy miss-passing and miss-trapping.
Four minutes into second half, Spain almost extended their lead but custodian Vikas Dahiya came to his side's rescue to deny Serrahima.
The Indians continued to attack but goals eluded them as Spanish goalkeeper Perez came up with a double save to deny Armaa Qureshi first and then Manpreet (Jr) from the rebound.
India finally tasted success in the 57th minute from their fifth penalty corner. This time too, the hosts failed to stop the push but Sumit did enough to get a shot at the goal which was saved by the Spanish goalkeeper and from the rebound Simranjeet scored to the delight of the home fans.
In the last 10 minutes, India got four more penalty corners and the penultimate one was eventually converted by Harmanpreet to take the lead for the first time in the match.
Jack Welch then scored the winner for Australia in the 58th minute to take his side to the semi-finals.