Fernando Alonso came through from 11th on the grid to take a remarkable home victory in the European Grand Prix in Valencia.
The result made the Ferrari driver the first repeat winner of the incredible 2012 Formula 1 season, and also moved Alonso into the championship lead.
The latter outcome was due in large part to Sebastian Vettel retiring with a mechanical problem on his Red Bull after dominating the first half of the race, and Lewis Hamilton's McLaren retiring late on in a collision with Pastor Maldonado's Williams as they fought for third.
Lotus's Romain Grosjean had looked like a victory threat as he chased Alonso, only to suffer an alternator failure, but his team-mate Kimi Raikkonen came through to claim second after a late pass on the fading Hamilton, whose incident with Maldonado then allowed Michael Schumacher to make his podium return for Mercedes in third place, chased by 19th-place qualifier Mark Webber's Red Bull.
Vettel commanded the early stages, immediately pulling out a lead of several seconds as the pack behind took several corners to sort itself out. Front row qualifier Hamilton got away slowly, and had to fend off several attackers before establishing himself in second ahead of Grosjean, Kamui Kobayashi, Maldonado, Raikkonen, Nico Hulkenberg and the fast-starting Alonso.
During the opening stint Alonso overtook Hulkenberg and followed Raikkonen past Maldonado, then jumped Raikkonen and Kobayashi by running one lap longer before his first pitstop.
This group then came out in a long train of yet-to-stop cars, through which Alonso made much more assertive progress than his rivals.
Approaching half-distance, Vettel was leading by 20 seconds over Grosjean, who had overtaken Hamilton with a neat outside-line move on lap 10 and then pulled out a 10s gap over the McLaren, which had Alonso edging closer.
When the safety car was called out to clear debris from a clash between Jean-Eric Vergne's Toro Rosso and Heikki Kovalainen's Caterham, most drivers made their second and final pitstops. Hamilton's was very slow, allowing Alonso to get up to third, and the Spaniard then went around the outside of Grosjean into the first corner at the restart to claim second.
Moments later that second place became the race lead, as Vettel's Red Bull suddenly cut out and retired, to the world champion's shock.
Grosjean kept Alonso under pressure and still seemed a likely winner, only for an alternator failure to halt the Lotus with 17 laps to go.
After that Alonso was able to pull clear and become the first repeat winner of the 2012 season, retaking the championship lead in the process.
Hamilton held on to second until the final two laps, when his tyres appeared to wilt. Raikkonen got past after a long battle, but when Maldonado tried to do likewise, the pair clashed, putting the McLaren in the barriers and breaking the Williams's front wing.
That allowed Schumacher through to claim the first podium of his Formula 1 return, as fended off Webber, who made great progress through from 19th on the grid.
Both Schumacher and Webber passed the Force Indias in the closing stages, with Nico Rosberg then getting his Mercedes between Hulkenberg and Paul di Resta's Force Indias to take sixth on the last lap.
Jenson Button had a low-key run to eighth for McLaren, ahead of Sergio Perez's Sauber and the limping Maldonado.
The second Ferrari of Felipe Massa was delayed with damage from a collision with Kobayashi and finished a lowly 16th. Kobayashi had to retire after the incident.
For some of the race it looked like Caterham might score its first point, as solid pace and the attrition ahead allowed Vitaly Petrov to pick his way up to 10th place. But the Russian was pushed back down the order and then tangled with Toro Rosso's Daniel Ricciardo.
PROVISIONAL RACE RESULTS
The European Grand Prix
Valencia Street Circuit, Europe;
57 laps; 308.883km;
Pos Driver Team Time
1. Alonso Ferrari 1h44:16.449
2. Raikkonen Lotus-Renault + 6.421
3. Schumacher Mercedes + 12.639
4. Webber Red Bull-Renault + 13.628
5. Hulkenberg Force India-Mercedes + 19.993
6. Rosberg Mercedes + 21.176
7. Di Resta Force India-Mercedes + 22.886
8. Button McLaren-Mercedes + 24.653
9. Perez Sauber-Ferrari + 27.777
10. Maldonado Williams-Renault + 34.630
11. Senna Williams-Renault + 35.900
12. Ricciardo Toro Rosso-Ferrari + 37.000
13. Petrov Caterham-Renault + 1:15.871
14. Kovalainen Caterham-Renault + 1:34.654
15. Pic Marussia-Cosworth + 1:36.565
16. Massa Ferrari + 1 lap
17. De la Rosa HRT-Cosworth + 1 lap
18. Karthikeyan HRT-Cosworth + 1 lap
19. Hamilton McLaren-Mercedes + 2 laps
Fastest lap: Rosberg, 1:42.163
Driver Team On lap
Grosjean Lotus-Renault 41
Vettel Red Bull-Renault 34
Kobayashi Sauber-Ferrari 34
Vergne Toro Rosso-Ferrari 27
Glock Marussia-Cosworth 1
World Championship standings, round 8:
1. Alonso 111 1. Red Bull-Renault 176
2. Webber 91 2. McLaren-Mercedes 137
3. Hamilton 88 3. Lotus-Renault 126
4. Vettel 85 4. Ferrari 122
5. Rosberg 75 5. Mercedes 92
6. Raikkonen 73 6. Sauber-Ferrari 60
7. Grosjean 53 7. Williams-Renault 45
8. Button 49 8. Force India-Mercedes 44
9. Perez 39 9. Toro Rosso-Ferrari 6
10. Maldonado 30
11. Di Resta 27
12. Kobayashi 21
13. Hulkenberg 17
14. Schumacher 17
15. Senna 15
16. Massa 11
17. Vergne 4
18. Ricciardo 2
All timing unofficial