Eight-time champions India came from behind to collect their 13th men's Olympic hockey medal with a hard-fought 2-1 win over Spain in the bronze medal match on Thursday.

Harmanpreet Singh scored two penalty corners after Marc Miralles had given Spain the lead at the Yves du Manoir Stadium in Colombes, northwest of Paris.

It is India's fourth bronze medal, and second in succession following Tokyo, and adds to those eight golds, the last of which came in 1980, and three silvers.

India had won seven of their previous 10 encounters with three-time champions Spain but after a cagey first half they found themselves trailing when Miralles fired an 18th minute penalty stroke past the 'Wall of India' Sreejesh Raveendran, playing his 336th and final international.

Borja Lacalle almost made it two, beating Sreejesh only to see his shot rebound off the post.

With the country's richest man Mukesh Ambani supporting from the stands, India began to press hard and with just a few seconds remaining of the first half, Harmanpreet buried a penalty corner to level the scores.

Three minutes after the break, Harmanpreet repeated the trick, sweeping another penalty corner just inside the Spanish post.

It was his tenth goal of the tournament, making Harmanpreet the top scorer at these Olympics.

Spain picked up the tempo in the final quarter, forcing a series of late penalty corners and one outstanding save from Sreejesh which ensured that India would take the bronze medal, the country's fourth medal in Paris.

World champions Germany face Netherlands in the gold medal match later on Thursday.