Max Verstappen beat Charles Leclerc to pole position for the Emilia Romagna Grand Prix sprint race in an incident-packed qualifying session at Imola.
There were five red flags in a rain-affected session and Verstappen ended up 0.8 seconds quicker than Leclerc.
George Russell and Lewis Hamilton qualified only 11th and 13th before the rain came down in Mercedes' least competitive showing of the season.
McLaren's Lando Norris was third, from Haas driver Kevin Magnussen.
Red Bull's Verstappen, who retired from two of the first three races of the season, said: "It was tricky out there with the dry/rain. It was very slippery. It was hectic, a long qualifying but of course in the end happy to be here. It is an amazing track and it really punishes you if you make a mistake.
"Our first three races in general didn't go to plan but we will try to have a good weekend here."
Ferrari's Carlos Sainz caused one of the stoppages when he crashed at Rivazza early in the second session, and the Spaniard will start 10th.
The other red flags were caused by a brake failure for Williams' Alexander Albon in the opening minutes of the first session, an off for Magnussen at Acque Minerali, Alfa Romeo's Valtteri Bottas pulling off the track and then finally a mistake by Norris when the session resumed for what should have been a final one-lap shootout.
Verstappen's pole time was set on a lap on which the Dutchman had to back off for Bottas' stranded car. He was allowed to keep the time because he had slowed sufficiently for the incident.
Before that, Ferrari's Leclerc had been 0.02secs quicker than Verstappen on their first laps of the final session.
But while Leclerc chose to back off before going for a second lap, Verstappen kept going for another time straight away.
The championship leader admitted he was annoyed and that he had made the "wrong choice".
The session decided the grid for Saturday's sprint race, the results of which set the starting places for the main grand prix on Sunday.
The number of points for the sprint this year have been increased, with eight points for the winner, and all those finishing in the top eight rewarded.
Behind Magnussen in fourth, Alpine's Fernando Alonso was fifth, ahead of Daniel Ricciardo's McLaren, the second Red Bull of Sergio Perez, Bottas, Sebastian Vettel in the improved Aston Martin and Sainz.
Leclerc leads the drivers' standings by 34 points from Russell with Verstappen a further 12 points back in sixth.
What happened to Mercedes?
Neither Mercedes went through to Q3 for the first time since the 2012 season when Michael Schumacher and Nico Rosberg were their driversIt was a chastening day for Mercedes, who looked uncompetitive from the start of practice.
The two cars were five and seven seconds off the pace in the rain of first practice and although they were in better shape in qualifying, the team had both cars knocked out in second qualifying for the first time since the 2012 Japanese Grand Prix.
Mercedes were unlucky with the Sainz red flag as rain started to fall during the pause in the session while the Ferrari was removed from the barriers.
That robbed them of the chance to improve and make it into the top 10 shootout, but it would have been touch and go anyway.
Hamilton said he felt the team had "underperformed" but it is clear Mercedes need to get to the bottom of what is causing the car's problems quickly if this season is not to be a total write-off.
"It wasn't a great session. Came here with optimism and everyone is working hard at the factory but it is disappointing," the Briton told Sky Sports.
"There are things we should have done but we didn't. We will work as hard as we can to move up in the sprint race.
"It is what it is. Each weekend is a rescue."
Sainz's error was his second in as many competitive days, after he crashed out of the Australian Grand Prix two weeks ago.
He said: "It's a shame. I felt comfortable. I don't understand because I wasn't going at full speed. I have no choice but to apologise. The sprint race remains to come back as much as possible."
Carlos Sainz has signed a new contract to drive for Ferrari until 2024