The Hungarian Grand Prix was supposed to be an exercise in damage limitation for Mercedes. Winning was a long-shot and "wasn't realistic", in the words of team boss Toto Wolff, in Ferrari territory.
Yet ultimately it was Mercedes and Lewis Hamilton inflicting the damage on Ferrari rather than sustaining it, thanks to what was ultimately a dominant victory.
That Mercedes came within six laps of an astonishing one-two, before Valtteri Bottas's rearguard action disintegrated, makes what happened even more unlikely. At the end of a half-season of endless plot twists, Hamilton and the Mercedes team converting disaster into triumph for the second time in seven days is a hugely significant one.
"We came to the last race and they kind of blew us away a little bit in qualifying," said Hamilton after his 67th grand prix victory. "They would have done here had it been dry, so we welcome the wet races."
The Hungarian GP wasn't a wet race, but it was won in the wet. Qualifying is as critical as ever on the twisty Hungaroring, and the sodden track and Saturday's wet-shod Q3 session defined what happened on Sunday. Hamilton and Bottas annexed the front row, with a quarter-of-a-second separating them.
This was largely down to Hamilton's brilliance in the final sector, where he was 0.426 seconds quicker. The key was taking an unorthodox, in wet conditions, tight line through the Turn 13 left-hander while Bottas and Sebastian Vettel both scrabbled for grip on the wider line.
Hamilton then had an immaculate run through the final corner, while Bottas had the rear step out on him and leaked more time.
"With the technology and data it seems to be a little bit easier for drivers to get closer to each other," said Hamilton of driving in the wet earlier in the weekend. "But when it comes to those conditions, when it is about feel, that is when it is magnified the most and that is when the driver is able to make the biggest difference."
Where the track was at its wettest, in the final sector, Hamilton excelled and his reward was the best possible track position for Sunday. The question is whether Ferrari's drivers should have done better?
Kimi Raikkonen certainly believed he should have done had he nailed it in Q3. Raikkonen was still ahead of Vettel, who admitted he didn't have the tidiest lap, and was adamant with a clean run he could have taken pole. But as Vettel suggested, in the wet the Ferrari certainly didn't seem to have the advantage it did in the dry.
"At the last race they kind of blew us away in qualifying. They would have done here had it been dry"Lewis Hamilton
"Probably we are not as competitive in the wet as we are in the dry," said Vettel. "It came down to the final lap, I pushed quite hard and tried everything. Maybe it wasn't the tidiest lap, but it also wasn't awful.
"We've not had much running in the wet this year so far and in the little bit we had, we had some work to do. In the dry, it could have been a different outcome. It wasn't, so we need to make sure that in the wet we are there."
The fact Ferrari runs with a higher-rake configuration than Mercedes - along with Red Bull, which looked likely to slot in between Ferrari and Mercedes on pace in dry conditions - was proposed by some as the reason.
The wet tyres marginally increase the ride height and could compromise the sealing of the underfloor thanks to changing the interaction between aero components and the ground.
But tyre preparation in full-wet conditions surely also played a part, and most significantly the drivers not getting the most from the car did too.
The Ferrari wasn't suddenly a bad car in the wet, and as Vettel was beaten by Raikkonen he could, objectively, have gone quicker. And if Raikkonen thought pole was on, you have to assume the failure to achieve that was down to the drivers not making the most of it. That Hamilton has won the last nine rain-influenced grands prix perhaps tells you something.
Once in this predicament, Ferrari was fighting a losing battle to overturn its track position disadvantage. Given its single-lap pace advantage in dry conditions, an edge that became far smaller in the wet, this turned a race it should have controlled, perhaps with a Red Bull or two as a buffer to Mercedes, into a very difficult one.
Both Mercedes drivers started on ultrasoft Pirellis, while Ferrari split its strategy with Raikkonen matching them and Vettel starting on softs. Ferrari's opportunity to change the race was to split, or even clear both, of the Mercedes drivers when the red lights went out.
But it was as-you-were at the start, with Hamilton assuming the lead from Bottas and the Ferraris falling in behind in grid order. Until, that is, Vettel went around the outside of Raikkonen at Turn 2 to take up the fight. While his team-mate was compliant, it was a superb move by Vettel that transformed his race.
With the Red Bulls out of the picture - Daniel Ricciardo thanks to qualifying 12th in the wet and Max Verstappen after retiring from fifth place with an MGU-K failure and causing a brief virtual safety car having jumped Saturday sensation Pierre Gasly on the run to Turn 1 then passed Carlos Sainz Jr through the first corner - the race boiled down to a straight fight between Mercedes and Ferrari.
It was down to Ferrari to force the issue, which it did by bringing Raikkonen into the pits for softs after just 14 of the 70 laps. Mercedes covered that move by bringing Bottas in to set up two duelling pairs.
At that point, Hamilton had built a lead of 6.5s over Bottas, who had Vettel sat behind him and floating between a second and two seconds behind. Mercedes expected Ferrari to try something different, but it went aggressive in pulling Raikkonen, who was running just behind Vettel, in so early. The fact Bottas faced a 55-lap run to the flag on a single set of softs after Mercedes' retaliatory stop would prove very significant in the race's denouement.
Hamilton then needed to draw out the life of the ultrasofts for as long as possible. He did this very effectively, attacking on laps 14-16 to extend his lead over Vettel to 8.7s.
"The tyres converge," said Hamilton of the relative pace of ultrasofts versus softs. "If you draw a line of the tyre life you've got the ultrasoft which starts quickest and it drops off and there's a crossover between the soft and the ultrasoft [pace].
"By the time Valtteri had pitted and Sebastian had clean air, I was able to react to the times that he was putting in. So we were matching that crossover - but I was able to match his times for a good period of time and that's really what made the race."
That he was able to do this is hugely encouraging for Mercedes, which generally struggles for pace on the ultrasoft compared to Ferrari thanks to rear temperature management troubles. As Hamilton pointed out, that's good news for another Mercedes trouble spot - September's Singapore GP.
The key was the set-up changes made from Friday to Saturday, which protected the rears more and might even have meant Mercedes could have extracted some more qualifying pace had it been dry.
It's asking a lot to suggest that would have allowed Hamilton and Bottas to outpace the Ferraris, but it might have made things easier than they looked on Friday when neither Mercedes driver could keep their rears alive all the way to the final part of the lap on their qualifying simulations.
Hamilton went all the way to lap 25 before stopping. By that time, Vettel had closed to 4.6s behind, and it was clear he was going to stay out on the softs with a view to attacking Hamilton on the ultrasofts later in the race.
After Hamilton's stop, the Mercedes pitwall made it very clear to him that the priority was to look after the rear tyres to ensure they had the necessary life to go to the end with enough performance to keep Vettel at bay.
That led to an uncomfortable period of 10 laps when Vettel had enough of a lead to pit under a virtual safety car and emerge ahead. Fortunately for Mercedes, that VSC didn't crop up, but it illustrates how serious the concerns about tyre life were.
Vettel had extended the gap to third-placed Bottas, who was under pressure from Raikkonen, to around the 25s mark. But by the time he dived into the pits on lap 39 Vettel, thanks to a combination of traffic and Bottas unleashing prodigious pace and setting a couple of fastest laps, was down to just 20.7s ahead.
Vettel came in to take on ultrasofts, and the time loss on track was compounded by spending 4.2s in his pitbox thanks to a delay getting the front left wheelnut tightened. Vettel emerged from the pits around 1.5s behind Bottas, immediately asking the pitwall if he couldn't have been left out for a few more laps before stopping to rebuild the gap.
Had he stopped a few laps earlier, and had there not been the gunning delay, Vettel would have been ahead. But as Vettel pointed out, that was down to the fear the ultrasofts might not hold up to the end of the 70-lap race.
"It was good that we were faster on an older tyre than Valtteri and pulled a gap," said Vettel when asked about the reason for delaying the pitstop. "It's a bit difficult to foresee the traffic and I lost quite a lot. Then we had the pitstop [problem].
"They [Mercedes] don't call us and say 'our tyres still look good, you can come in earlier'. Obviously, the worst that can happen is that you come in earlier, you gain the position and then you fall apart at the end.
"With the circumstances, we lost out and we came out behind. I think without that it would have been a much more relaxed last part of the race, probably hunting down Lewis. But with the gap that he had, I think it would have been difficult to catch him. And then it's a completely different story, especially around here, to overtake.
"I think we could have done the catching bit, but not really the overtake. So it doesn't change the final result, it's just that it was a bit more work than coming out ahead."
A bit more work is an understatement. Up front, Hamilton was effectively home free and Ferrari had missed its opportunity to give Vettel track position over Bottas.
"Mercedes don't call us and say 'our tyres still look good, you can come in earlier'"Sebastian Vettel
There were a few question marks about tyre management, but Hamilton drove immaculately with the Bottas buffer keeping both of the Ferraris at bay. Both Ferraris because Raikkonen rapidly closed up after making a second pitstop on lap 38. He regained fourth when Ricciardo finally made his sole pitstop on lap 44 and latched onto the back of the second-place battle with 12 laps to go.
There was a point during this phase of the race when a VSC triggered by Stoffel Vandoorne's retirement meant Mercedes briefly considered pitting Bottas again to guarantee third ahead of Raikkonen, but the decision was made to go aggressive - and rightly so.
Vettel's final attack on Bottas was made on lap 65, when he closed rapidly with DRS assistance on the run to Turn 1. Bottas defended, putting him on a wide line at the exit while Vettel cut back inside him.
On the run into the Turn 2 left-hander, Vettel was ahead but, with Bottas squeezed on the inside line, he turned across the Mercedes. Bottas was still half thinking about trying to hang on despite the pass being as good as done, and as he desperately tried to avoid the Ferrari once it became clear contact was inevitable he clipped Vettel with his front wing.
"I still had my nose inside into Turn 2, he was on the outside, he turned in very early for me and for me there was nowhere to go," said Bottas. "We touched and I was the only one who got damaged. Fair enough, I think racing incident."
The stewards noted the incident but clearly agreed as there was no investigation. Vettel, who escaped unscathed, believed he was already ahead but didn't blame Bottas for what happened because he knew how little grip the Mercedes driver had.
With Bottas quickly relegated to fourth behind Raikkonen and struggling with front wing damage, he soon fell into the clutches of Ricciardo. The Australian had spent 27 laps climbing from 16th, where he ended the first lap, to fifth and clear of the midfield. After a 44-lap opening stint on softs, he was flying on ultrasofts and tried to go around the outside of Bottas three laps from home.
Bottas tried to compete on the brakes, but didn't have the front end, locked up the front-right and clattered Ricciardo. The stewards hit him with a 10s penalty despite Mercedes then ordering Bottas to let Ricciardo past - something he didn't seem willing to do but that happened on the last lap anyway - and rightly so.
Bottas knew his car was hobbled and should have accepted Ricciardo was going to relegate him to fifth. For 64 laps, Bottas had done what Mercedes needed him to before it all unravelled, and the usually-cool Finn seemed to lose his head as a result.
This was the only thing that could in any way compromise Hamilton's day as he reeled off the remaining laps to take victory by 17.1s. But although Vettel doing his own bit of damage limitation by recovering to second means Hamilton only takes a 24-point lead into the August break, the reigning champion couldn't hide his delight at having put one over Ferrari for the second time in seven days.
"I could only have dreamed we would be in the position that we are in right now, considering all factors and based on our pure performance compared to the Ferraris," he said after back-to-back wins at Hockenheim and the Hungaroring.
And all because of one factor - the weather - changing at a key moment and transforming the competitive balance twice in the space of seven days.
The Hungarian Grand Prix was supposed to be an exercise in damage limitation for Mercedes. Winning was a long-shot and "wasn't realistic", in the words of team boss Toto Wolff, in Ferrari territory.
Yet ultimately it was Mercedes and Lewis Hamilton inflicting the damage on Ferrari rather than sustaining it, thanks to what was ultimately a dominant victory.
That Mercedes came within six laps of an astonishing one-two, before Valtteri Bottas's rearguard action disintegrated, makes what happened even more unlikely. At the end of a half-season of endless plot twists, Hamilton and the Mercedes team converting disaster into triumph for the second time in seven days is a hugely significant one.
"We came to the last race and they kind of blew us away a little bit in qualifying," said Hamilton after his 67th grand prix victory. "They would have done here had it been dry, so we welcome the wet races."
The Hungarian GP wasn't a wet race, but it was won in the wet. Qualifying is as critical as ever on the twisty Hungaroring, and the sodden track and Saturday's wet-shod Q3 session defined what happened on Sunday. Hamilton and Bottas annexed the front row, with a quarter-of-a-second separating them.
This was largely down to Hamilton's brilliance in the final sector, where he was 0.426 seconds quicker. The key was taking an unorthodox, in wet conditions, tight line through the Turn 13 left-hander while Bottas and Sebastian Vettel both scrabbled for grip on the wider line.
Hamilton then had an immaculate run through the final corner, while Bottas had the rear step out on him and leaked more time.
"With the technology and data it seems to be a little bit easier for drivers to get closer to each other," said Hamilton of driving in the wet earlier in the weekend. "But when it comes to those conditions, when it is about feel, that is when it is magnified the most and that is when the driver is able to make the biggest difference."
Where the track was at its wettest, in the final sector, Hamilton excelled and his reward was the best possible track position for Sunday. The question is whether Ferrari's drivers should have done better?
Kimi Raikkonen certainly believed he should have done had he nailed it in Q3. Raikkonen was still ahead of Vettel, who admitted he didn't have the tidiest lap, and was adamant with a clean run he could have taken pole. But as Vettel suggested, in the wet the Ferrari certainly didn't seem to have the advantage it did in the dry.
"At the last race they kind of blew us away in qualifying. They would have done here had it been dry"Lewis Hamilton
"Probably we are not as competitive in the wet as we are in the dry," said Vettel. "It came down to the final lap, I pushed quite hard and tried everything. Maybe it wasn't the tidiest lap, but it also wasn't awful.
"We've not had much running in the wet this year so far and in the little bit we had, we had some work to do. In the dry, it could have been a different outcome. It wasn't, so we need to make sure that in the wet we are there."
The fact Ferrari runs with a higher-rake configuration than Mercedes - along with Red Bull, which looked likely to slot in between Ferrari and Mercedes on pace in dry conditions - was proposed by some as the reason.
The wet tyres marginally increase the ride height and could compromise the sealing of the underfloor thanks to changing the interaction between aero components and the ground.
But tyre preparation in full-wet conditions surely also played a part, and most significantly the drivers not getting the most from the car did too.
The Ferrari wasn't suddenly a bad car in the wet, and as Vettel was beaten by Raikkonen he could, objectively, have gone quicker. And if Raikkonen thought pole was on, you have to assume the failure to achieve that was down to the drivers not making the most of it. That Hamilton has won the last nine rain-influenced grands prix perhaps tells you something.
Once in this predicament, Ferrari was fighting a losing battle to overturn its track position disadvantage. Given its single-lap pace advantage in dry conditions, an edge that became far smaller in the wet, this turned a race it should have controlled, perhaps with a Red Bull or two as a buffer to Mercedes, into a very difficult one.
Both Mercedes drivers started on ultrasoft Pirellis, while Ferrari split its strategy with Raikkonen matching them and Vettel starting on softs. Ferrari's opportunity to change the race was to split, or even clear both, of the Mercedes drivers when the red lights went out.
But it was as-you-were at the start, with Hamilton assuming the lead from Bottas and the Ferraris falling in behind in grid order. Until, that is, Vettel went around the outside of Raikkonen at Turn 2 to take up the fight. While his team-mate was compliant, it was a superb move by Vettel that transformed his race.
With the Red Bulls out of the picture - Daniel Ricciardo thanks to qualifying 12th in the wet and Max Verstappen after retiring from fifth place with an MGU-K failure and causing a brief virtual safety car having jumped Saturday sensation Pierre Gasly on the run to Turn 1 then passed Carlos Sainz Jr through the first corner - the race boiled down to a straight fight between Mercedes and Ferrari.
It was down to Ferrari to force the issue, which it did by bringing Raikkonen into the pits for softs after just 14 of the 70 laps. Mercedes covered that move by bringing Bottas in to set up two duelling pairs.
At that point, Hamilton had built a lead of 6.5s over Bottas, who had Vettel sat behind him and floating between a second and two seconds behind. Mercedes expected Ferrari to try something different, but it went aggressive in pulling Raikkonen, who was running just behind Vettel, in so early. The fact Bottas faced a 55-lap run to the flag on a single set of softs after Mercedes' retaliatory stop would prove very significant in the race's denouement.
Hamilton then needed to draw out the life of the ultrasofts for as long as possible. He did this very effectively, attacking on laps 14-16 to extend his lead over Vettel to 8.7s.
"The tyres converge," said Hamilton of the relative pace of ultrasofts versus softs. "If you draw a line of the tyre life you've got the ultrasoft which starts quickest and it drops off and there's a crossover between the soft and the ultrasoft [pace].
"By the time Valtteri had pitted and Sebastian had clean air, I was able to react to the times that he was putting in. So we were matching that crossover - but I was able to match his times for a good period of time and that's really what made the race."
That he was able to do this is hugely encouraging for Mercedes, which generally struggles for pace on the ultrasoft compared to Ferrari thanks to rear temperature management troubles. As Hamilton pointed out, that's good news for another Mercedes trouble spot - September's Singapore GP.
The key was the set-up changes made from Friday to Saturday, which protected the rears more and might even have meant Mercedes could have extracted some more qualifying pace had it been dry.
It's asking a lot to suggest that would have allowed Hamilton and Bottas to outpace the Ferraris, but it might have made things easier than they looked on Friday when neither Mercedes driver could keep their rears alive all the way to the final part of the lap on their qualifying simulations.
Hamilton went all the way to lap 25 before stopping. By that time, Vettel had closed to 4.6s behind, and it was clear he was going to stay out on the softs with a view to attacking Hamilton on the ultrasofts later in the race.
After Hamilton's stop, the Mercedes pitwall made it very clear to him that the priority was to look after the rear tyres to ensure they had the necessary life to go to the end with enough performance to keep Vettel at bay.
That led to an uncomfortable period of 10 laps when Vettel had enough of a lead to pit under a virtual safety car and emerge ahead. Fortunately for Mercedes, that VSC didn't crop up, but it illustrates how serious the concerns about tyre life were.
Vettel had extended the gap to third-placed Bottas, who was under pressure from Raikkonen, to around the 25s mark. But by the time he dived into the pits on lap 39 Vettel, thanks to a combination of traffic and Bottas unleashing prodigious pace and setting a couple of fastest laps, was down to just 20.7s ahead.
Vettel came in to take on ultrasofts, and the time loss on track was compounded by spending 4.2s in his pitbox thanks to a delay getting the front left wheelnut tightened. Vettel emerged from the pits around 1.5s behind Bottas, immediately asking the pitwall if he couldn't have been left out for a few more laps before stopping to rebuild the gap.
Had he stopped a few laps earlier, and had there not been the gunning delay, Vettel would have been ahead. But as Vettel pointed out, that was down to the fear the ultrasofts might not hold up to the end of the 70-lap race.
"It was good that we were faster on an older tyre than Valtteri and pulled a gap," said Vettel when asked about the reason for delaying the pitstop. "It's a bit difficult to foresee the traffic and I lost quite a lot. Then we had the pitstop [problem].
"They [Mercedes] don't call us and say 'our tyres still look good, you can come in earlier'. Obviously, the worst that can happen is that you come in earlier, you gain the position and then you fall apart at the end.
"With the circumstances, we lost out and we came out behind. I think without that it would have been a much more relaxed last part of the race, probably hunting down Lewis. But with the gap that he had, I think it would have been difficult to catch him. And then it's a completely different story, especially around here, to overtake.
"I think we could have done the catching bit, but not really the overtake. So it doesn't change the final result, it's just that it was a bit more work than coming out ahead."
A bit more work is an understatement. Up front, Hamilton was effectively home free and Ferrari had missed its opportunity to give Vettel track position over Bottas.
"Mercedes don't call us and say 'our tyres still look good, you can come in earlier'"Sebastian Vettel
There were a few question marks about tyre management, but Hamilton drove immaculately with the Bottas buffer keeping both of the Ferraris at bay. Both Ferraris because Raikkonen rapidly closed up after making a second pitstop on lap 38. He regained fourth when Ricciardo finally made his sole pitstop on lap 44 and latched onto the back of the second-place battle with 12 laps to go.
There was a point during this phase of the race when a VSC triggered by Stoffel Vandoorne's retirement meant Mercedes briefly considered pitting Bottas again to guarantee third ahead of Raikkonen, but the decision was made to go aggressive - and rightly so.
Vettel's final attack on Bottas was made on lap 65, when he closed rapidly with DRS assistance on the run to Turn 1. Bottas defended, putting him on a wide line at the exit while Vettel cut back inside him.
On the run into the Turn 2 left-hander, Vettel was ahead but, with Bottas squeezed on the inside line, he turned across the Mercedes. Bottas was still half thinking about trying to hang on despite the pass being as good as done, and as he desperately tried to avoid the Ferrari once it became clear contact was inevitable he clipped Vettel with his front wing.
"I still had my nose inside into Turn 2, he was on the outside, he turned in very early for me and for me there was nowhere to go," said Bottas. "We touched and I was the only one who got damaged. Fair enough, I think racing incident."
The stewards noted the incident but clearly agreed as there was no investigation. Vettel, who escaped unscathed, believed he was already ahead but didn't blame Bottas for what happened because he knew how little grip the Mercedes driver had.
With Bottas quickly relegated to fourth behind Raikkonen and struggling with front wing damage, he soon fell into the clutches of Ricciardo. The Australian had spent 27 laps climbing from 16th, where he ended the first lap, to fifth and clear of the midfield. After a 44-lap opening stint on softs, he was flying on ultrasofts and tried to go around the outside of Bottas three laps from home.
Bottas tried to compete on the brakes, but didn't have the front end, locked up the front-right and clattered Ricciardo. The stewards hit him with a 10s penalty despite Mercedes then ordering Bottas to let Ricciardo past - something he didn't seem willing to do but that happened on the last lap anyway - and rightly so.
Bottas knew his car was hobbled and should have accepted Ricciardo was going to relegate him to fifth. For 64 laps, Bottas had done what Mercedes needed him to before it all unravelled, and the usually-cool Finn seemed to lose his head as a result.
This was the only thing that could in any way compromise Hamilton's day as he reeled off the remaining laps to take victory by 17.1s. But although Vettel doing his own bit of damage limitation by recovering to second means Hamilton only takes a 24-point lead into the August break, the reigning champion couldn't hide his delight at having put one over Ferrari for the second time in seven days.
"I could only have dreamed we would be in the position that we are in right now, considering all factors and based on our pure performance compared to the Ferraris," he said after back-to-back wins at Hockenheim and the Hungaroring.
And all because of one factor - the weather - changing at a key moment and transforming the competitive balance twice in the space of seven days.