Pastor Maldonado scored his maiden Formula 1 win and ended a Williams victory drought dating back to the end of the 2004 season as the Venezuelan defeated local hero Fernando Alonso's Ferrari in an absorbing Spanish Grand Prix at Barcelona's Catalunya track.
The Williams and Ferrari were absolutely together going into the final laps, but the superbly composed Maldonado was able to edge away and secure victory, leaving Alonso to fend off Kimi Raikkonen's flying Lotus for second.
Alonso had taken the lead at the start by beating Maldonado into the first corner, and then inched into a three-second lead during the first stint, as they pulled clear of the rest of the field.
But the combination of a stunning out-lap by Maldonado and Alonso getting stuck behind Charles Pic's Marussia on his in-lap saw the Williams leapfrog the Ferrari at the second pitstops, and then storm away for a few laps until 7s clear.
Alonso then started coming back at Maldonado, getting the gap down to 4.2s before the Williams had a slightly slow final pitstop with a left-rear issue. A few laps behind Raikkonen, who was running much further before his final pitstop, meant the leaders were absolutely nose to tail going into the closing laps as both tried to keep their tyres intact.
For a while it looked inevitable that Maldonado would succumb to Alonso's pressure, but it was the Ferrari that started to lose pace in the final stages, and the lead gap began to increase again - allowing Maldonado to take a very unexpected victory by 3.1 seconds.
Raikkonen's fresher tyres allowed him to gain on the leaders at a ferocious rate as the race neared its end, but he ran out of time to catch Alonso, finishing six tenths of a second adrift.
Romain Grosjean finished fourth in the other Lotus, with Kamui Kobayashi pulling off some characteristically bold passes on the way to fifth for Sauber.
Red Bull's Sebastian Vettel produced a late charge to take sixth after losing ground with a drive-through penalty for failing to heed yellow flags and requiring a new front wing at his final pitstop.
Nico Rosberg's Mercedes and both McLarens fell victim to Vettel's surge up the order, with Rosberg then fending off last-place starter Lewis Hamilton for seventh as the Briton managed to make a two-stop strategy work against expectations. His team-mate Jenson Button struggled for pace all day and finished ninth.
Force India's Nico Hulkenberg resisted huge pressure from Mark Webber, who lost ground on lap one and needed an out-of-sequence pitstop for a new front wing.
Behind the Toro Rossos and the second Force India of Paul di Resta, Felipe Massa had another bad race for Ferrari. Penalised for a yellow flag infringement, he finished only 15th.
Retirements included Michael Schumacher and Bruno Senna, who tangled at Turn 1 when the fresh-tyre-shod Mercedes ran into the back of the yet-to-pit Williams, and Sergio Perez. The Sauber picked up a puncture while trying to attack the Lotus pair at the first corner, and later parked just after a messy pitstop.