Hamilton looked to have the race in the bag until the intervention by the safety car.
Kubica survived an intervention by the safety car and a crumbling track that provoked errors from several drivers.
The Briton led from start to finish, despite two safety car periods, with Rubens Barrichello second in Melbourne.
But with the crane on track, it necessitated the safety car, resulting in the pitlane being immediately closed.
The penalty was issued for overtaking Lewis Hamilton in a safety car period.
We needed some weather or a safety car at some stage to try to bring us back into the hunt.
We tried two extreme strategies, with Fernando quite short and me quite long, in the hope of getting a safety car.
McLaren blamed a wiring loom that had been burnt because of heat build-up while Raikkonen was going slowly behind the safety car.
BBC: SPORT | Motorsport | Formula One | Alonso survives Monaco thriller
"Without the safety car periods it'd have been a whole lot easier, but even so there were things to deal with, " he said.
Massa's race was ruined when he had to stop twice within a lap because of a breakdown in communication during the safety car period.
That allowed Vettel to take the lead until the safety car was brought out just a lap later following a crash by Narain Karthikeyan's HRT.
In Melbourne on Sunday, the safety car came out after a late collision between Red Bull's Sebastian Vettel and Robert Kubica in his BMW Sauber.
Heidfeld led as the safety car pulled off, ahead of eight other cars which did not stop during the caution period, and Kubica in 10th place.
And when the red flag finally came out, the track was so wet that the F1 cars could not keep up with the Mercedes safety car.
But then it was Button's turn to see his advantage disappear when the safety car slowed down the pack so debris could be cleared off the track.
After restarting the race on lap 39, they were again forced to sit behind the safety car following Michael Schumacher's smash into the back of Toro Rosso's Jean-Eric Vergne.
He suffered from the intervention of the safety car in both races, and scored only four points in two races in which he should have been on the podium.
Hamilton clearly wondered then, to give him the benefit of the doubt, if he had passed under the safety car conditions and was trying to let Trulli back through.
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.
The Englishman had built up a 6.8-second lead over Kubica when the safety car was deployed on lap 17 so that marshals could remove the stranded Force India of Adrian Sutil.
The Ferrari had the pace to battle for victory, and combined with his need for only a single stop, that put him sixth after the safety car's intervention, which became fifth when Trulli retired.
BBC: SPORT | Motorsport | Formula One | Alonso survives Monaco thriller
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.
With the safety car deployed, the teams took the opportunity to pit with Raikkonen cleverly holding up the line of cars as they entered the pits to allow team-mate Montoya, who was already with the mechanics, to finish his stop.
BBC: SPORT | Motorsport | Formula One | Raikkonen keeps title hopes alive
The dustiness off line means we should also keep our eye out for the safety car, especially because the inexperience of the marshals here means that the FIA are more likely to send out Bernd Maylander and his machine to slow down the field.
Alonso just managed to make it out of the pits in front of Raikkonen, who appeared set for a final charge for victory before smoke began pouring from his McLaren leaving the Loews hairpin on lap 50 while the safety car was still on the track.
BBC: SPORT | Motorsport | Formula One | Alonso survives Monaco thriller
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.
Just two laps after Alonso came in early to take on more fuel, Piquet's crash forced the deployment of the safety car and the subsequent pit stop of nearly all other drivers, an action that promoted Alonso to fifth from where he went onto to secure victory.
Just two laps after Alonso came in early to take on more fuel, Piquet's crash forced the deployment of the safety car and the subsequent pit stop of nearly all the other drivers -- an action that promoted Alonso to fifth from where he went on to secure victory.
CNN: Ex-Renault chief Briatore wins appeal over lifetime F1 ban
But the emphasis on safety in car adverts comes from the same place.
FORBES: Maybe The Tech Industry Should Grow Up And Stop Being So Sexist
应用推荐