(CNN) -- Formula One world championship leader Lewis Hamilton extended his title advantage after an extraordinary pit lane incident scuppered the hopes of his main rival Felipe Massa in the inaugural Singapore Grand Prix.
Ferrari's Massa drives away from his pit place with the fuel hose still attached.
Hamilton finished third behind Fernando Alonso and Nico Rosberg to open up a seven-point lead over Massa with just three rounds remaining.
Ferrari's Massa had been comfortably leading the first-ever night Grand Prix when the safety car was deployed following a crash which saw Renault's Nelson Piquet Jr. hit a trackside wall.
Massa and the other leading contenders took the opportunity to refuel but the Brazilian attempted to pull away while the gasoline rig and hose was still attached to his Ferrari.
A pit crew member took a nasty tumble in the ensuing chaos and Massa was forced to come to a halt further up the pit lane.
His support team desperately fought to pull off the trailing hose but by the time they had succeeded he was in 18th spot and dead last.
The Brazilian was given a drive-through penalty for unsafe release because he almost collided with another car while leaving the pit with the hose.
The mechanic who was brought down by the snaking hose was carried away on a stretcher for a check-up at the on-track medical center.
Hamilton, who also slipped back in the confused situation, picked his way through to a distant third behind Alonso and Williams driver Rosberg before the race was given yet more added drama when Adrian Sutil crashed his Force India car to set up another safety car situation.
Alonso, who had the good fortune to come in for an early pit stop before the accident involving his Renault team-mate Piquet, drove peerlessly away after the second safety car delay, with Hamilton content to settle for third place.
It was the 20th win of former world champion Alonso's Formula One career.
Toyota driver Timo Glock was fourth with Toro Rosso's Sebastian Vettel following up his win in Italy this month with fifth. BMW Sauber's Nick Heidfeld took sixth.
Hamilton had gone into the Singapore round with a slender one-point lead over Massa having failed to overturn his demotion from first to third in the Belgian Grand Prix.
He was making little impression behind the pace of the polesitter until the incidents that changed the course of the race and possibly the world championship race.
The six points claimed by Hamilton also took McLaren into first place in the constructors' championship with Massa's Ferrari team-mate Kimi Raikkonen carelessly colliding with the wall while in fifth place.