Nico Rosberg pipped Mercedes team-mate Lewis Hamilton to pole position at the German Grand Prix in a dramatic qualifying session.
Rosberg had to abort his first run in the top 10 shootout because of an electronic error but had the fastest lap of the weekend on his final run.
Hamilton went out to do his final lap afterwards but two errors meant he ended up 0.107secs adrift.
Daniel Ricciardo headed Max Verstappen in an all Red Bull second row.
The Ferraris of Kimi Raikkonen and Sebastian Vettel were fifth and sixth.
Rosberg beats Hamilton fair and square
Rosberg’s pole was his second in a row and his fifth of the season but perhaps more importantly it is the first time he has beaten Hamilton on merit when the two have been shooting it out in the final seconds of the session.
Of his four previous poles, Hamilton was unable to compete in China and Russia because of engine problems, he crashed in the European Grand Prix in Baku after an error-strewn performance and had to back out of his final lap in Hungary last weekend when he came across Fernando Alonso’s McLaren, which had spun.
As such, it was an important step for Rosberg, who lost the championship lead to Hamilton for the first time this season following the Briton’s fifth win in six races last weekend.
The two title rivals are now tied 6-6 on their head-to-head pole position record this season.
“It is a great feeling,” said Rosberg. “Just a great lap. I also had extra fuel because to make sure I do have another shot, so I had fuel for three laps.”
Hamilton said afterwards: “It has been a good weekend. I had no problems. I had the pace today but I just didn’t finish it off on the last lap.”
What’s wrong with Vettel (and Ferrari)?
Red Bull confirmed their recent surge in form, which is looking like it could move them ahead of Ferrari as the second team in the championship and Ricciardo confirmed his position as a qualifying ace.
The Australian edged Verstappen by 0.108secs and has still been beaten only once in qualifying by a team-mate all year.
Ferrari were again disappointing. On a weekend that started with news that had parted company with their highly rated technical director James Allison, Raikkonen was 0.779secs off pole – and 0.173secs ahead of Vettel, who looked out of sorts.
Vettel also incurred the wrath of McLaren’s Fernando Alonso, who accused him of holding him up on his final run.
Alonso stormed out of the McLaren garage after being knocked out in the second session, which he ended 14th, two places and 0.132secs behind team-mate Jenson Button.
Briton’s Jolyon Palmer put in a strong performance to line up 16th, a place and 0.061secs ahead of his more experienced team-mate Kevin Magnussen as both face questions over their futures at the Renault team in 2017.