Germany's Jonathan Hilbert took the silver medal and Canada's Evan Dunfee claimed the bronze.
India's Gurpreet Singh slowed down considerably during the race and was seen sitting on the sidelines after the 35km mark, being helped by the medical team of the race but did not seem to be in much trouble.
The World record holder has now won four Olympic medals overall, having also taken 5,000m silver in 2008 and bronze in 2004.
Sandeep finishes 23rd, Irfan and Rahul 47th and 51st
Kenya's Peres Jepchirchir won the Olympics women's marathon in Sapporo on Saturday, out-duelling compatriot Brigid Kosgei in the final minutes and claiming her country's second consecutive gold medal in the event. Kosgei took silver and Molly Seidel of the United States, competing in just her third marathon after moving up from shorter distances, claimed bronze.
'It was of course very, very difficult, especially in the second half. We saw the temperature on the building, so maybe every 10K it was one degree higher and higher.'