Budapest:Finn Heikki Kovalainen secured his maiden Formula One victory in dramatic circumstances on Sunday -and preserved McLaren Mercedes team-mate Briton Lewis Hamilton's lead in this year's drivers world championship.
In an amazing and dramatic race of unpredictable twists and turns, the 26-year-old Kovalainen took full advantage when luckless Brazilian Felipe Massa's Ferrari engine blew up three laps from the end to win the Hungarian Grand Prix.
As smoke billowed from his car, Massa slowed and stopped, gifting the quiet Nordic driver his first win in his first season with the McLaren team after spending his rookie year at Renault last season.
For Massa, an almost-certain victory was thrown away by a reliability problem that may have cost him his chance of lifting the world drivers' title as luck appeared to be on Hamilton's side.
Hamilton, who started from pole, lost the lead to Massa at the first corner, was out-raced by the Brazilian and suffered a puncture before finishing fifth - but ended up with an increased lead of five points in the title race ahead of defending champion Finn Kimi Raikkonen.
Raikkonen, in the other Ferrari, came home third behind the amazing German Timo Glock who was second for Toyota just a fortnight after leaving the German Grand Prix in an ambulance following a big crash.
Two-times world champion Spaniard Fernando Alonso, the man who swapped seats with Kovalainen, was fourth for Renault head of Hamilton.
Hamilton was out-paced off the grid and passed at the opening corner. He ran second for a long period until a puncture after 41 of the 70 laps wrecked his hopes of completing a hat-trick of wins.
Massa led brilliantly until three laps from the finish when he was hit by misfortune and had to pull out leaving Kovalainen to grab the best result of his career, 11 seconds ahead of Glock who grabbed his first podium finish.
The result left Hamilton five points ahead of Raikkonen in the drivers championship with Massa now eight points behind.
"I think I did the best of the worst if you like, in the end," said a relieved Hamilton.
"I had no idea about the puncture and the team did a great job to help me back into that race - and last year I think I lost the championship because of punctures.
"But congratulations to Heikki who drove a great race and he deserves his win. We have taken points from our rivals today and made the best of things. It could have been a whole lot worse."
Massa made a sensational start.
It was a major feat for Massa and Ferrari - and the team roared with celebration in their pit garage - as the Latin American steadily pulled clear to open up and advantage as Hamilton struggled to stay in touch.
Four points behind before the race, Massa had an opportunity to reclaim the lead in the title battle and both he and Hamilton knew it as they streaked away from the rest of the field.
On a sweltering day at this bumpy, tight and dusty circuit, Massa was 3.5 seconds ahead by lap 15 and pitted for the first time after 18 laps, conceding the lead to Hamilton.
But the Englishman led for only one lap before he, too, pitted after leading the field ahead of Kovalainen. When he rejoined in a disappointing sixth place, it seemed he had sufficient additional fuel to stay out longer than Massa to claim a possible tactical advantage.
Surprisingly, at this stage, Glock was running second and ahead of both Alonso and Raikkonen.
Hamilton struggled to catch Massa and, after German Sebastian Vettel had become the first retirement in his Toro Rosso, he fell more than four seconds behind before picking up a puncture on lap 41.
His left-front tyre deflated rapidly and he was forced to limp to the pits.
After switching from a set of hard tyres to soft, and refuelling, he rejoined in 12th place with 28 laps remaining -- and Massa in cruise mood at the front.
Hamilton mounted a solid revival to score points in the closing stages and he gained his reward after battling through to fifth after Massa's massive misfortune.