Magnussen made a regulation stop in pit lane and the car was being pushed toward the team garage when flames emerged at the top of the fuel tank.
The Danish driver was instructed to immediately get out, and he sprang out just as the flames began to lick at the side of the vehicle's cockpit. He was unhurt in the incident.
Team mechanics and track marshals sprayed the car in extinguishing foam, but it repeatedly reignited as fuel continued to pump out of the leak at the crest of the bodywork, behind the on-board camera.
New eruptions of fire lasted for several minutes as crew and marshals stood poised with extinguishers pointed at the car, intermittently spraying at the fresh flames.
After the team managed to attach a hose and drain the tank, the fire was finally brought under control.
The incident caused the session to be red-flagged for 15 minutes before the pit lane was deemed safe enough to resume. Renault's technical director Nick Chester said an early investigation put the blame on a faulty breather valve, which allows air to vent into the fuel tank.
Pit lane fires have been a rarity since the sport banned refueling in 2010 on cost rather than safety grounds, mainly because of the high expense of transporting the hi-tech fuel rigs around the world.
Jos Verstappen, father of current Red Bull driver Max Verstappen, was caught in the middle of a terrifying pit lane fire during the German Grand Prix in 1994 as a sudden ball of flame erupted around and over his car while he was sitting in it.