Brawn GP's Rubens Barrichello won the European Grand Prix to claim his first Formula One victory in five years.
The 37-year-old Brazilian took advantage of a costly pit-stop error by Lewis Hamilton's McLaren team to record his 10th career win - his first since the 2004 Chinese GP - and boost his championship hopes.
Hamilton finished second ahead of Ferrari's Kimi Raikkonen after having started the Valencia street race from pole position.
Jenson Button finished seventh to have his championship lead cut to 18 points over teammate Barrichello. Red Bull's Mark Webber finished ninth, and is 20.5 points behind Button.
Luca Badoer, who is filling in for injured Ferrari driver Felipe Massa, finished 17th after starting last.
Hamilton, who also finished second at last year's race, looked to be cruising to a second straight win after having taken the Hungarian GP. But McLaren's mechanics fumbled when removing tire warmers during his final pit stop, which lasted 13.4 seconds, and the chance was gone.
"This is very, very rare that this happens," said Hamilton, who was called in with his fuel load running out before the team reconsidered too late. "I'd crossed the white line when they told me to finish my lap, but then I would have lost too much time."
As Hamilton's exasperated father Anthony and pop star girlfriend Nicole Scherzinger looked on, Barrichello moved clear in front after his second stop and held on to win by 2.3 seconds.
"I was pushing like hell. A hard win, Especially after five years, you don't forget how to do it but it's tough," Barrichello said after making it 100 victories for Brazilian drivers in F1.
He dedicated his victory to Massa, who is recovering from lifesaving brain surgery after a loose part came off Barrichello's car and struck the Ferrari driver in the helmet at the Hungarian GP.
"This was an emotional one for me. He's such a good friend and I wish him the very best," Barrichello said.
McLaren's Heikki Kovalainen finished fourth after starting second, while Nico Rosberg of Williams rounded out the top five ahead of Renault's Fernando Alonso.
Red Bull's championship hopes took a hit after both Sebastian Vettel and Webber finished out of the points.
Vettel withdrew for the second straight race, pulling out due to an engine failure near the halfway mark. Drivers are only allowed to use eight engines per season and the German is believed to have used seven already, further complicating his title hopes.
Webber led Button for most of the race but surrendered seventh spot after the second round of stops to finish behind BMW Sauber's Robert Kubica.
Button, who won six of the first seven races but has finished no better than fifth in the past four, leads the overall standings with 72 points. Barrichello has 54, Webber 51.5 and Vettel 47. Brawn GP also increased its constructors' lead to 27.5 points over Red Bull.
Only Brazilians have won at the harbor-side track, with Massa winning from pole last year.
"The last 10 laps, everything came up in my mind," Barrichello said. "It was a tough one, but a fantastic one. People seemed to think that was it for me but I can show now that it wasn't."
Hamilton got out of the start unscathed, with Raikkonen the only mover after using his KERS overtaking system to pass Vettel and Button and move into fourth place behind Barrichello.
Button dropped into eighth spot before being overtaken by Webber after five laps. Button, who later set a new record with a lap time of 1:38.874, stayed on the Australian's tail and eventually moved ahead.
Badoer's return to F1 for the first time in 10 years was forgettable. The 38-year-old Italian spun out on the opening lap and was passed after leaving pit lane by Renault's Romain Grosjean, who finished 15th in his debut race.
Badoer, who stretched his record pointless streak to 49 races, had to perform a drive-through penalty for crossing over the pit-lane line and was eventually lapped by the leaders.