BUDAPEST, Hungary — Sebastian Vettel's luck changed for the better at the Hungarian Grand Prix on Sunday, where the German driver won to extend his championship lead over archrival Lewis Hamilton by 14 points heading into the summer break.

Vettel's fourth win of the season came from pole position, on a Hungaroring track where overtaking is notoriously difficult. Yet his 46th career win turned out to be anything but a processional affair.

Even before the start, Vettel felt something was wrong with his steering wheel. It bugged him most of the race, but with his teammate Kimi Raikkonen driving brilliantly behind him to fend off the fast-closing Mercedes, Vettel held on and Ferrari got a 1-2 with Raikkonen second. Montreal's Lance Stroll finished 14th.

It was some change from two weeks ago at the British GP, where Vettel's tire punctured two laps from the end, denying him a certain podium place. At Silverstone, he just about crawled home to finish seventh, with his lead over Hamilton slashed from 20 points to a meagre one.

But Vettel now jets off into his month-long break with his spirits high again in his hunt for a fifth F1 title, and first since the last of his four straight titles driving for Red Bull in 2013.

"I'm over the moon. It was a really difficult race, maybe it didn't look like but I had my hands full," the German driver said. "The steering started to go sideways and it seemed to get worse. Then I stayed off the kerbs, tried to save the car. I didn't do a favour to Kimi."

Raikkonen, never known as a "Yes man" in F1, played the game and stayed behind Vettel, protecting him from the encroaching threat of Mercedes drivers Valtteri Bottas, who was third, and Hamilton, who placed fourth.

With his contract up for renewal, it might prove a shrewd move from Raikkonen, who had enough speed to win. He hasn't won since the season-opening Australian GP in 2013. But maybe he saw the bigger picture.

As a model teammate to Vettel, the Finn might get a new multi-million deal for 2018 at the ripe old age of 38.

"A big thank you to the team," said Vettel, who should especially buy Raikkonen a drink before they go on holiday. "Kimi could have gone a lot faster than me for the majority of the race."

Raikkonen used all of his experience to help Vettel.

"It wasn't ideal, as I felt I had the speed," Raikkonen said. "We know as teammates what we had to do."

Asked if he could have won the race, he replied "Definitely."

Earlier, Bottas had let Hamilton past in order to attack the Ferraris. Hamilton then sportingly gave him third place back right at the end.

"The team kept the promise which I'm really happy about," said Bottas, who is 33 points behind Vettel in third place overall.

Over at Red Bull, there is unlikely to be such harmony.

Red Bull's Max Verstappen was fifth after knocking his teammate Daniel Ricciardo out of the race on the first lap.

Ricciardo's race was over after the contact on Turn 2, bringing the safety car out for a few laps as his car was towed off the track.

Verstappen was the perpetrator — swerving into his teammate when going wide on the exit from a turn.

It was a big blow for Ricciardo, who had secured five podium finishes in the previous six races. As he watched replays of the incident in his team garage, Ricciardo looked stone-faced when he saw confirmation that Verstappen was responsible.

Verstappen, who was given a 10-second time penalty for the incident, subsequently apologized to Ricciardo.

Hamilton had written off his chances of victory after qualifying in fourth place, saying it would be an "easy breeze" for Ferrari on the twisty 4.4-kilometre (2.7-mile) circuit nestling in the hills surrounding Budapest. Only the sinewy street circuit of Monaco is tougher to overtake on. Vettel also won there this year, with Raikkonen second.

That race was much easier, but Ferrari faced an awkward dilemma this time around. As the race wound down Vettel was still leading but clearly slowing down Raikkonen just behind him.

Ferrari did not impose team orders on Vettel to let Raikkonen past him, so Mercedes sensed an opportunity.

Bottas let Hamilton past him, on the condition that he would give the position back if he couldn't get a clean shot.

In the end, he couldn't get quite close enough to Raikkonen, so the gentleman's agreement stood and he gave Bottas the podium spot.