Mark Webber took the lead of the Formula 1 world championship with victory in an enthralling Hungarian Grand Prix.
The Australian was bundled down to third at the start behind his Red Bull team-mate Sebastian Vettel and Fernando Alonso's Ferrari.
But a combination of a perfect strategy call from his pit crew and some exceptional speed throughout the middle of the race helped him to beat Alonso to the chequered flag by 17.8 seconds.
Key to Webber's victory was the deployment of the safety car on lap 15 to enable the recovery of debris between turns 13 and 14.
While most drivers pitted for their mandatory tyre changes, Red Bull pulled a strategic masterstroke as Webber was left out on the circuit and moved into the lead.
As the race resumed Webber led from Vettel, Alonso, Lewis Hamilton's McLaren and Felipe Massa's Ferrari, the Australian knowing that he would need to pull out enough of a gap in the remaining laps to enable him to make his tyre change under green flag conditions.
His task was made easier when Vettel was given a drive-through penalty for failing to keep within 10 car lengths of his team-mate while behind the safety car, which dropped the German to third behind Alonso.
When Webber did eventually make his tyre change, on lap 43, he had built up a lead of over 23s, and that enabled him to rejoin the circuit still with 4s in hand over the Ferrari. It was an advantage he extended all the way to the finish and to his fourth win of the season.
Hamilton, by this time, had retired with a suspected gearbox failure. That ensured that he lost his championship lead to Webber, who now has a four-point advantage over the Briton.
Massa was no match for the front three, but finished an untroubled fourth.
Vitaly Petrov drove a sensational race in his Renault as he took a career-best fifth place, one spot ahead of his 2009 GP2 Series title rival Nico Hulkenberg.
Hulkenberg's Williams team-mate Rubens Barrichello held sixth for a long time, but made his tyre change late and dropped down the order.
The Saubers of Pedro de la Rosa and Kamui Kobayashi finished seventh and ninth, sandwiching the McLaren of world champion Jenson Button.
Michael Schumacher looked on course to round out the top 10, but came under late pressure from Barrichello, who had far fresher rubber in the latter stages of the race.
Barrichello closed onto the tail of the Mercedes looked set to pass Schumacher heading down to Turn 1 with a few laps left.
Schumacher squeezed him against the pit wall - for which race stewards will investigate him after the race - but Barrichello held his nerve and took the final points position.
Another man with the pace to finish in the top 10 was Robert Kubica, but his race was effectively ended by a pitlane collision with Adrian Sutil while the safety car was on-track.
Kubica was released by the Renault team into the path of Sutil's Force India, which had already begun to turn into his own pit stall.
The Pole continued, only to be given a 10s stop/go penalty for causing the incident. He retired a few laps later.
Sutil, however, was out on the spot and so too was Nico Rosberg, whose Mercedes shed its right-rear wheel just seconds earlier and left him stranded at the pit exit.
The only other retiree was Jaime Alguersuari, who pulled his Toro Rosso off the track with smoke pouring from its engine bay on the second lap.
PROVISIONAL RACE RESULTS The Hungarian Grand Prix The Hungaroring, Hungary; 70 laps; 306.663km; Weather: Sunny. Classified: Pos Driver Team Time 1. Webber Red Bull-Renault 1h41:05.571 2. Alonso Ferrari + 17.821 3. Vettel Red Bull-Renault + 19.252 4. Massa Ferrari + 27.474 5. Petrov Renault + 1:13.100 6. Hulkenberg Williams-Cosworth + 1:16.700 7. De la Rosa Sauber-Ferrari + 1 lap 8. Button McLaren-Mercedes + 1 lap 9. Kobayashi Sauber-Ferrari + 1 lap 10. Barrichello Williams-Cosworth + 1 lap 11. Schumacher Mercedes + 1 lap 12. Buemi Toro Rosso-Ferrari + 1 lap 13. Liuzzi Force India-Mercedes + 1 lap 14. Kovalainen Lotus-Cosworth + 3 laps 15. Trulli Lotus-Cosworth + 3 laps 16. Glock Virgin-Cosworth + 3 laps 17. Senna HRT-Cosworth + 3 laps 18. Di Grassi Virgin-Cosworth + 4 laps 19. Yamamoto HRT-Cosworth + 4 laps Fastest lap: Vettel, 1:22.362 Not classified/retirements: Driver Team On lap Hamilton McLaren-Mercedes 25 Kubica Renault 25 Rosberg Mercedes 17 Sutil Force India-Mercedes 17 Alguersuari Toro Rosso-Ferrari 2 World Championship standings, round 12: Drivers: Constructors: 1. Webber 161 1. Red Bull-Renault 312 2. Hamilton 157 2. McLaren-Mercedes 304 3. Vettel 151 3. Ferrari 238 4. Button 147 4. Mercedes 132 5. Alonso 141 5. Renault 106 6. Massa 97 6. Force India-Mercedes 47 7. Rosberg 94 7. Williams-Cosworth 40 8. Kubica 89 8. Sauber-Ferrari 23 9. Schumacher 38 9. Toro Rosso-Ferrari 10 10. Sutil 35 11. Barrichello 30 12. Petrov 17 13. Kobayashi 17 14. Liuzzi 12 15. Hulkenberg 10 16. Buemi 7 17. De la Rosa 6 18. Alguersuari 3 All timing unofficial