Sebastian Vettel made full use of the virtual safety car to sneak in front of Lewis Hamilton and hold off the frustrated champion to win Formula One's season-opening Australian Grand Prix on Sunday.
The Mercedes engine's infamous 'party mode' that delivered Hamilton a blistering pole lap on Saturday could do little once Ferrari's Vettel nosed ahead when re-entering from pit-lane midway through the race at Albert Park.
Pole-sitter Hamilton had appeared set to coast to victory with a clear pace advantage but the race turned on its head with the safety car, which was called after Romain Grosjean's Haas failed and rolled to a stop at turn two.
In another bonus for Ferrari, Kimi Raikkonen finished third, fending off Red Bull's Daniel Ricciardo and leaving the unlucky Australian still searching for a first podium in his home race.
Four-times world champion Vettel claimed a 48th overall win and his third in Melbourne following his victories at Albert Park last year and in 2011.
"It was needless to say we got a bit lucky with the timing of the safety car," the German, who had started from third place and inherited the lead when Hamilton and Raikkonen had pitted earlier in the race, told reporters.
"It's not the easiest track to pass."
For Hamilton, the result was a bitter pill to swallow and had echoes of last year's race.
Vettel also managed to re-enter in front of him from pit-lane in 2017 before burning away to victory while the pole-sitting Briton was blocked by traffic.
Mercedes boss Toto Wolff said his team had miscalculated the margin between the cars during the safety car period.
"We thought we had enough margin," he told the BBC. "It must have been a software bug in the system that caused us to get it wrong. We are digging deep now to understand where we had a problem."
Hamilton, who cockily spoke of "wiping the smile off" Vettel's face with his pole lap on Saturday, battled to keep positive.
"Even now I don't understand what's happened," the 33-year-old told reporters. "I did everything I believe I was supposed to do."
After the pit-lane setback, Hamilton drove hard to reel in Vettel and battled back after taking a slide at a corner that blew out the lead to nearly three seconds.
But he finally waved the white flag in the closing laps to preserve the car for future races.
Twice world champion Fernando Alonso finished fifth for McLaren in the team's first race with Renault power, equalling their best result in three dreary years with previous engine suppliers Honda.
Red Bull's Dutch wunderkind Max Verstappen finished sixth after suffering a full 360-degree spin on the 10th lap that put him out of the running.
Hamilton's team mate Valtteri Bottas finished eighth after starting 15th, having taken a five-place grid penalty for a gearbox change after a heavy crash during qualifying.
A weekend that begun brightly for Haas with a strong qualifying turned sour during the race when Grosjean and Kevin Magnussen ground to a halt in quick succession before the halfway mark.
The team was fined 10,000 euros ($12,000) by stewards after it emerged they had failed to secure wheels properly on both cars during botched tyre-changes when pitted.
They were among five cars that failed to finish the eventful opener, including Williams' Russian debutant Sergey Sirotkin who blamed a rogue plastic sandwich bag for destroying the car's brakes. ($1 = 0.8097 euros)