Disconsolate and bewildered was certainly not how Lewis Hamilton will have expected to feel as the first race of the new Formula One season to come to a close.

Dominant all weekend, buoyant and invigorated after a masterful qualifying, the defending champion looked quietly confident that his attempt to take a fifth title would be off to a winning start. It was optimism that was shattered in a matter of seconds as Ferrari’s Sebastian Vettel opened the year with a win, just as he did last season.

Hamilton would doubtless have been less bemused had he been passed on track. However, after the British driver dominated from pole for 20 of the race’s 58 laps, Vettel took the lead by taking advantage of pitting under the virtual safety car and emerging in front.

Australian Grand Prix: F1 2018 season opener – live! Read more

It was far from the most satisfying way to take the win but Vettel, who admitted Ferrari do not have the same pace as Mercedes, grasped it with both hands.

Mercedes had pitted Hamilton on lap 20 to match the stop by Kimi Raikkonen, who was in second and finished in third place. At the time Hamilton had a comfortable lead of more than six seconds to Vettel. His car had looked strong and untroubled in the clean air at the front of the field.

Ferrari kept Vettel out, however, and when Romain Grosjean’s retirement at the side of the track triggered the virtual safety car on lap 26, Ferrari pounced to take advantage of the cars on track being forced to drive to a slower lap time, enabling them to send the German out in the lead.

“Even now I don’t understand what happened,” said Hamilton. “I did everything I believed I needed to. Disbelief was how I felt from that moment until the end.”

The team had not given him any special instructions in order to cover the potential advantage that Ferrari would enjoy of pitting under the virtual safety car and ultimately the Mercedes team principal, Toto Wolff, admitted they had made a mistake.

Wolff said the software they had used to calculate the gap Hamilton needed to establish to ensure he remained ahead had delivered an erroneous number. The team thought Hamilton had time in hand even with a virtual safety car and so had not advised him to push harder and extend the gap.

“The software or system we have been using for five years just gave us the wrong number,” Wolff said. “He did nothing wrong. It was down to a software bug or an algorithm that was simply wrong.”

Facebook Twitter Pinterest Lewis Hamilton was unable to get past Sebastian Vettel once the German had come out from the pits in front. Photograph: Diego Azubel/EPA

Hamilton’s confusion after the race was understandable. He had led from pole and looked entirely in control for the opening stint. He opened a gap ahead of the two chasing Ferraris and at no point did either look as though they had the pace to close it, let alone attempt to pass.

Overtaking is notoriously difficult at Albert Park and once Vettel had made it to the front, Hamilton could pressure him but do little else.

Vettel admitted Ferrari had enjoyed some good fortune. “We got a bit lucky with the timing of the safety car,” he said. “If you are at the front you can control the race, we know overtaking is difficult. Lewis was probably the quickest of the three of us but that’s the way it goes.”

Hamilton must be wondering quite what he must do to claim another win in Australia. He has two here but has failed four times in the past five years to convert pole to victory. In qualifying he had been dominant too – he was seven-tenths clear of Vettel in third.

Mercedes’ confidence in their car has been justified but this will be a blow to the trust they had in their decision making processes.

For Vettel it is the perfect start to a campaign that, should he ultimately win, would give him five titles, equalling Juan Manuel Fangio. He had been circumspect during testing and in the buildup to the race. Although outclassed by Hamilton in qualifying he had been confident that the Scuderia would show better pace in the race and he proved that they are again intent on doing everything possible to take the fight to their rivals, especially while not enjoying quite the same level of performance as the Mercedes.

Imperious Lewis Hamilton has Formula One history in his sights | Giles Richards Read more

Hamilton had joked after qualifying that he had wanted “to wipe the smile off” Vettel’s face, which the German did not find amusing. Instead, he said he preferred to focus on the race and, where it mattered, he has come away with the points, leaving Mercedes to examine of how such form in qualifying and early race dominance left their title-defending driver scratching his head as to why he had not finished on the top step.

Behind the leaders Red Bull’s Daniel Ricciardo made a spirited recovery to finish in fourth place from eighth on the grid and although his team-mate Max Verstappen could manage only sixth after an uncharacteristic spin, their car looked strong.

McLaren enjoyed their best result since 2016 with Fernando Alonso making the most of their new Renault engine to claim fifth.

Nico Hulkenberg’s Renault was in seventh in front of Valtteri Bottas who had recovered from 15th on the grid, with the second McLaren of Stoffel Vandoorne in ninth and the second Renault of Carlos Sainz in 10th.