Max Verstappen led a Red Bull one-two as he took pole position for the season-opening Bahrain Grand Prix.
The Dutchman beat team-mate Sergio Perez by 0.138 seconds, with the Ferraris of Charles Leclerc and Carlos Sainz locking out the second row.
Fernando Alonso made an impressive start to his time at Aston Martin with fifth place, ahead of both Mercedes cars.
George Russell beat Lewis Hamilton to sixth place by just 0.044secs.
Leclerc had been second after the first runs in final qualifying, 0.103secs behind Verstappen, but Ferrari chose not to do a second run to enable them to start the race on new tyres rather than used so he lost out on a second chance to try to get ahead.
Red Bull went into the weekend as strong pre-season favourites but they have struggled to make the car handle in a way that satisfied the drivers and had appeared not to have the advantage many expected.
In the end, the grid had a look many would have predicted after testing last week, but Verstappen said it had not been easy.
“It’s been a bit of a tough start to the weekend yesterday and today, not really finding my rhythm,” he said. “But luckily in qualifying we managed to put the pieces together.
“I was positively surprised to be on pole after the struggles we had in practice.”
Perez said: “I don’t remember such a tight qualifying battle from Q1 to Q2 to Q3. In the end, I wasn’t totally comfortable with the balance but to getting this kind of start to the season with the team was really special.”
Leclerc said Ferrari’s decision to pull out of the final battle for pole was based on the knowledge that their tyre wear was not as good as that of their rivals.
“There wasn’t any [technical] issue,” he said. “I think we were in the fight for pole, which was a good surprise after the testing and practices, which were a bit more difficult.
“However, we have to keep in mind that we have been struggling a bit on the long run and I think we are in a better place to start on new tyres.
“It was very close. Aston Martin were very quick, Mercedes were very quick at some times. We are a lot closer than we expected. In the race run, we seem to have bit of a weakness for now. Having a set of new tyres will help us.”
Leclerc’s team-mate Carlos Sainz did do a second run, but after being 0.361secs off Leclerc on the first he was able only to halve that gap on his final attempt and had to be satisfied with fourth.
Alonso well in the fight
The weekend has been dominated by talk of Alonso and Aston Martin.
The veteran double world champion, who moved this year to the team who finished seventh in 2022, has been quick throughout practice and many thought he might be in the fight for pole.
In the end, that was a step too far, and Alonso ended up just over 0.5secs off Verstappen’s pace, having done just one run on new tyres in the final session rather than Red Bull’s two.
But that marks a huge step forward for the team compared to last year and more than justifies Alonso’s decision to leave Alpine.
Alonso, whose race pace looks strong and will fancy his chances of at least beating the Ferraris in the grand prix, was also ahead of both Mercedes, who supply Aston Martin their engines and did two runs in Q3.
Sixth and seventh is not what Mercedes wanted but it is better than they feared after Friday, when Hamilton had said they were “on the wrong track” and “a long way off”.
Alonso’s team-mate Lance Stroll took eighth, despite two injured wrists after a cycling crash two weeks ago, with the Alpine of Esteban Ocon and Nico Hulkenberg’s Haas completing the top 10.
McLaren’s Lando Norris was 11th while rookie team-mate Oscar Piastri was knocked out in the first session and down in 18th, admitting to making errors in his final lap.