Heikki Kovalainen celebrated the first grand prix victory of his career with the words of Ron Dennis, the McLaren team principal, ringing in his ears.

"Welcome to the world of winning," Dennis told Kovalainen, after the driver finally achieved victory in an eventful race in Hungary. The Finn, who has often endured wretched luck this season, became the 100th winner in Formula One history, after enjoying a welcome change in his fortunes.

In sweltering heat at the Hungaroring, Kovalainen's team-mate Lewis Hamilton suffered more tyre trouble and was propelled down the field when running second.

And then, three laps from home, a Ferrari engine blew for the first time in almost two years, robbing Felipe Massa of victory.

"Of course I feel a little sorry for Felipe, and even for Lewis, because they both drove a great race," said a respectful Kovalainen after the 28th race of his F1 career. "But I know how they feel because I've had similar moments myself this year, quite a few times.

"After Saturday I've been in a position to fight for the victory, but something has always gone wrong, something hasn't functioned perfectly.

"Today, Massa and Lewis were both very fast at the beginning of the race, but halfway through I felt it was starting to work for me a little better.

"At the end I just tried to pressure Massa and hope something would happen, and obviously it looked like he had a mechanical failure. So it all worked fine for me and I am very, very happy about it.

"To stand on the top step of the podium and to hear the Finnish anthem playing for me was fantastic. It was a great moment. I have spent a lot of time trying to achieve this goal, so to do so is very pleasing. Hopefully this is the first of many. We just need to keep focused, have a little break and then try to repeat this at the next round."

Hamilton had dominated practice and was attempting to become the first driver since Damon Hill in 1996 to win three consecutive races following his victories in Britain and Germany.

But he was beaten away from the line by Massa who executed a superb move around the outside of the Briton into turn one to leap from third to first.

From that moment Massa was comfortable, even more so when Hamilton sustained what was understood to be a sidewall puncture to his left front tyre on lap 41.

Once the second round of pit stops had passed, Hamilton was running sixth and on course to lose his world championship lead to Massa. However, then came the unexpected on lap 67, as Massa's Ferrari engine gave way down the start-finish straight, handing Kovalainen his win and helping Hamilton extend his title-race lead to five points.

On Hamilton's part, there was a mixture of disappointment and relief with regard to how his race ebbed and flowed. "It was not as bad as it could have been, and not as good either," said the Englishman. "But my lead is bigger now and you would never have thought that with all that has gone on this year."

Toyota's Timo Glock claimed his maiden podium with second place, ahead of Kimi Raikkonen.

Reigning world champion Raikkonen, who had started from sixth, finished third and is now five points behind Hamilton, who also had Renault's Fernando Alonso ahead of him in fourth.

The remaining points-scoring positions were taken up by Nelson Piquet in his Renault, Toyota's Jarno Trulli and BMW Sauber's Robert Kubica.