The Petronas Raceline Malaysia star completed the 26-lap rain-soaked circuit in 51:47.584s behind winner Dominique Aegerter (51:39.709s) and second-place Thomas Luthi (51:41.109s).
The 23-year-old, who could not contain his emotions after the race, last stood on the podium in 2012 when the then-wildcard rider finished third at the Malaysia Grand Prix.
Meanwhile, fellow Malaysian rider Khairul Idham Pawi finished ninth.
An emotional @HafizhPetronas looks happy with his first podium in 5 years! ? #SanMarinoGP pic.twitter.com/ZtZje5DCtP
— MotoGP™??? (@MotoGP) September 10, 2017
(Picture: Facebook/Official Fan Club Hafizh Syahrin 55 pescao)