Sebastian Vettel won a tense Hungarian Grand Prix on Sunday in a Ferrari one-two that stretched his championship lead to 14 points after Mercedes rival Lewis Hamilton sportingly surrendered third place to his teammate.
The German, savouring his fourth win of the season and 46th of his Formula One career, took the chequered flag 0.9 seconds ahead of team mate Kimi Raikkonen.
The Finn had looked faster than Vettel for most of the afternoon.
"I'm over the moon, that was a really difficult race," said the winner, who had to wrestle with a skewed steering wheel on a sweltering afternoon at the Hungaroring and had no room for error.
Hamilton finished fourth after slowing down on the last lap and allowing Finnish team mate Valtteri Bottas to go past, despite the loss of vital points to the Briton's championship challenge.
Bottas had let Hamilton through on the 45th of the 70 laps, on the assurance that his teammate would hand back the place if he could not overtake the Ferraris, and the triple champion duly kept his word.
"Really thanks to Lewis for keeping the promise in the end and letting me by," said Bottas.
"I don't think every teammate would have swapped back."
Hamilton, whose radio was malfunctioning for some of the race and would have had more of a chance had he got past Bottas earlier, said he had done what he had to do.
"It's tough in the championship but I'm a man of my word," he said.
"I did say that if I can't overtake them I would let him back through."
On a circuit where overtaking is notoriously hard, the top five all finished in their starting order with Max Verstappen fifth for Red Bull.
The Dutch teenager was handed a 10 second stop and go penalty for colliding with his Australian teammate Daniel Ricciardo on the opening lap.
The impact ended Ricciardo's race, with the car stranded on the track and fluid leaking from the broken radiator, and brought out the safety car.
"It’s not on. It was amateur to say the least. It’s not like he was trying to pass -- there was no room to pass," said an angry Ricciardo.
"I don’t think he likes it when a teammate gets in front. You’ve got the whole race to try and repair the mistake but the pass was never on. It wasn’t even a pass, it was a very poor mistake."
Fernando Alonso, who celebrated his 36th birthday on Saturday, gave struggling McLaren their best finish of the season so far by taking sixth place and also setting the fastest lap of the race.
Belgian teammate Stoffel Vandoorne was 10th in a double points finish for the former champions, who moved off the bottom of the table and ahead of Sauber.
Spaniard Carlos Sainz was seventh for Toro Rosso with Mexican Sergio Perez eighth and Force India team mate Esteban Ocon ninth.
Britain's Paul di Resta, replacing unwell Brazilian Felipe Massa at Williams, retired.
The last Ferrari driver to win from pole position in Hungary was Vettel's compatriot Michael Schumacher, who was dominant in 2004 and went on to win his seventh and last championship that season.
Hungary was the last race before the August break, with nine of the 21 rounds remaining.
Renault's Nico Hulkenberg branded Haas rival Kevin Magnussen the "most unsporting" driver in Formula One after a Hungarian Grand Prix clash between the two on Sunday.
Hulkenberg had been frustrated by the Dane forcing him off as he tried to pass at turn two in the closing stages of the race.
The Renault driver retired in the pits while Magnussen collected a five-second penalty but finished 13th.
"When it comes to racing, he's just nasty," said Hulkenberg, who 'congratulated' Magnussen in front of television reporters in an angry exchange that turned the air blue when the Dane replied.
"Hard defending is fine but what he does is just ruthless and sending people into the wall."
Magnussen had earlier criticised Hulkenberg over the team radio for an incident involving his French Haas team mate Romain Grosjean.
"If you can do what Hulkenberg did to Romain, then it's going to be a dirty race," he said.