Heikki Kovalainen took a shock first Formula One victory in the Hungarian Grand Prix after the dominant Felipe Massa suffered an engine failure with three laps to go and Lewis Hamilton fell back with a puncture.
The late drama allowed Timo Glock to take his maiden podium in second place, as the Toyota driver fended off Kimi Raikkonen's Ferrari in the closing stages.
Although Hamilton had dominated most of the weekend, it was Massa who surged to the front as soon as the lights went out at the start.
The Ferrari immediately passed second place qualifier Kovalainen, then drew alongside Hamilton on the outside into Turn 1. Massa then locked up both front wheels as he braked extremely late for the corner, but managed to turn in ahead.
Massa then managed to edge away slightly in the first stint, and although he stopped one lap ahead of Hamilton at the end of their first stints, the Brazilian's lead had been sufficient to keep him in front after the stops.
Hamilton lost more time when he emerged behind Fernando Alonso and Raikkonen, who had yet to stop, and was running four seconds behind Massa and not catching the Ferrari when his left front tyre developed a puncture on lap 41.
The McLaren ran wide onto the Turn 5 run-off and had to cruise back to the pits, falling to 10th in the process, although the team were able to fuel Hamilton to the end of the race and he duly gained places as others stopped.
The incident left Massa with an ample lead over Kovalainen, who had been unable to keep up with the two leaders and only closed when Massa eased off in the closing stages.
With Kovalainen too far behind to challenge, Massa seemed set to take a well-earned victory and jump back into the world championship lead, only for his Ferrari engine to erupt in a cloud of smoke as he passed the pits with just three laps to go.
The devastated Brazilian came to a halt near the pit exit and was left to walk back to the garage as Kovalainen swept past to inherit an unlikely first win - making him the 100th driver to take an F1 victory.
Just two weeks after being hospitalised following his enormous Hockenheim accident, Glock proved his practice and qualifying achievements were no fluke by jumping from fifth to fourth at the start, then pitting a lap later than most of the leaders.
He moved up to third after Hamilton's problems, then appeared in second when Massa stopped, and stayed there despite Raikkonen closing in towards the finish.
The world champion had spent much of the afternoon bottled up behind Fernando Alonso's Renault after the Spaniard drove around the outside of Raikkonen as he battled with Robert Kubica into the first corner.
It was only at the final stops that Raikkonen managed to get past Alonso (despite running off the road at Turn 2 shortly before pitting), and he rapidly pulled away from the Renault once ahead, but could not get on terms with Glock.
Alonso found himself in fourth at the end, just ahead of the recovering Hamilton, with Nelson Piquet completing a strong day for Renault by beating Jarno Trulli to sixth.
Kubica only took one point home after falling back following a relatively early first stop, which left him stuck in traffic as his main rivals ran longer.
His BMW teammate Nick Heidfeld improved from 15th on the grid to 10th, between the two Red Bulls, thanks to a one-stop strategy.
The race was also notable for a bizarre series of minor fuel fires in the pits. Sebastien Bourdais, Kazuki Nakajima and Rubens Barrichello were all delayed in pitstops after small amounts of fuel leaked onto their cars as the nozzle was withdrawn, causing brief and ultimately harmless fires - twice in Bourdais' case. All three were able to continue and reach the finish.
PROVISIONAL RACE RESULTS The Hungarian Grand Prix The Hungaroring, Hungary; 70 laps; 306.663km; Weather: Sunny. Classified: Pos Driver Team Time 1. Kovalainen McLaren-Mercedes (B) 1h37:27.067 2. Glock Toyota (B) + 11.061 3. Raikkonen Ferrari (B) + 16.856 4. Alonso Renault (B) + 21.614 5. Hamilton McLaren-Mercedes (B) + 23.048 6. Piquet Renault (B) + 32.298 7. Trulli Toyota (B) + 36.449 8. Kubica BMW Sauber (B) + 48.321 9. Webber Red Bull-Renault (B) + 58.834 10. Heidfeld BMW Sauber (B) + 1:07.709 11. Coulthard Red Bull-Renault (B) + 1:10.407 12. Button Honda (B) + 1 lap 13. Nakajima Williams-Toyota (B) + 1 lap 14. Rosberg Williams-Toyota (B) + 1 lap 15. Fisichella Force India-Ferrari (B) + 1 lap 16. Barrichello Honda (B) + 2 laps 17. Bourdais Toro Rosso-Ferrari (B) + 3 laps 18. Massa Ferrari (B) + 3 laps Fastest lap: Raikkonen, 1:21.195 Not classified/retirements: Driver Team On lap Sutil Force India-Ferrari (B) 63 Vettel Toro Rosso-Ferrari (B) 23 World Championship standings, round 11: Drivers: Constructors: 1. Hamilton 62 1. Ferrari 111 2. Raikkonen 57 2. McLaren-Mercedes 100 3. Massa 54 3. BMW Sauber 90 4. Kubica 49 4. Toyota 35 5. Heidfeld 41 5. Renault 31 6. Kovalainen 38 6. Red Bull-Renault 24 7. Trulli 22 7. Williams-Toyota 16 8. Alonso 18 8. Honda 14 9. Webber 18 9. Toro Rosso-Ferrari 8 10. Glock 13 11. Piquet 13 12. Barrichello 11 13. Rosberg 8 14. Nakajima 8 15. Vettel 6 16. Coulthard 6 17. Button 3 18. Bourdais 2 All timing unofficial