Lewis Hamilton won the Hungarian Grand Prix from pole position on Sunday to clinch his first victory of a frustrating season.
Kimi Raikkonen was second after holding off a strong late challenge from Sebastian Vettel, who was third ahead of Red Bull teammate Mark Webber.
Hamilton's first year with Mercedes has been tricky, and he came into the race with low expectations of victory despite securing his fourth pole this season.
"This is probably one of the most important Grand Prix wins of my career,'' Hamilton said.
"The guys have done an exceptional job, I really couldn't be happier. I hope there are many more to come.''
He managed his tires wisely to get the 22nd GP win of his career and the first since the United States GP last November. Prior to Hungary, he had been third three times.
Hamilton remains fourth overall but likely too far behind to mount a serious title challenge as the season takes its mid-season summer break.
Leader Vettel has 172 points, 38 clear of Raikkonen and 39 ahead of Ferrari driver Fernando Alonso. Hamilton has 124, some 48 points adrift of Vettel.
The next race is the Belgian GP on August 25.
As he approached the finish line, Hamilton waved. After he won, he kissed his Mercedes and then hugged team boss Ross Brawn. When he raised the winner's trophy, Hamilton looked emotional as he pointed to members of his team to share the moment with them.
During the race, the British driver was in no mood for compromise, barking back at an engineer over the race radio, "Hey man, I'm trying to drive here. I'm happy with the way the car is'' when he received some advice inside the last 10 laps.
His teammate Nico Rosberg, who had split the past four GP wins with Vettel, had to abandon right near the end with flames billowing from the back of his car. He was unhurt.
Vettel has four wins overall, having won at the German GP three weeks ago.
He tried desperately to get past Raikkonen and they almost collided on the penultimate lap as the Finn blocked his move.
"I had no doubt that I could keep him out,'' Raikkonen said. "Everything worked well for us.''
Romain Grosjean started third and finished sixth in an eventful race for the Frenchman.
Rosberg started fourth ahead of the Ferrari of Alonso, who has not won since the Spanish GP in May.
The pressure was on tire manufacturer Pirelli at this race.
The teams recently held in-season testing sessions at Silverstone to assess new tires provided by Pirelli, after several spectacular blowouts on the same circuit at the British Grand Prix in June prompted a furious response and even a boycott threat from drivers.
Pirelli decided that from this race until the end of the season, it will revert to last year's tires combined with the current compounds from this season. Soft and medium tires were available for the race and they held up well.