Max Verstappen beat Charles Leclerc to the pole position for the sprint race at Imola.
There were five red flags in the rain and Verstappen ended up 0.8 seconds quicker than Leclerc.
The rain came down in Mercedes, which was the least competitive showing of the season.
Kevin Magnussen was third from Lando Norris.
Verstappen retired from two of the first three races of the season. It was very slippery. It was a long process but in the end happy to be here. If you make a mistake on that track, you will be punished.
We will try to have a good weekend despite the fact that our first three races did not go to plan.
The Spaniard will start 10th after he crashed at Rivazza early in the second session.
The other red flags were caused by a brake failure for 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 finally a mistake by Norris.
The pole time was set on a lap where Verstappen had to back off for the stranded car. He was allowed to keep the time because he slowed down.
Verstappen and Leclerc were both 0.02 seconds quicker on their first laps of the final session.
Verstappen kept going for another lap after Leclerc decided to back off.
The leader admitted that he had made the wrong choice.
The results of the session decided the grid for the sprint race and the starting places for the main grand prix on Sunday.
The number of points for the sprint has been increased this year, with eight points for the winner, and all those finishing in the top eight will be rewarded.
Fernando Alonso was fifth, ahead of Daniel Ricciardo's McLaren, the second Red Bull of Sergio Perez, and the improved Sainz.
Leclerc has a 34 point lead over Russell and Verstappen is 12 points back in sixth.
Mercedes looked uncompetitive from the start of practice.
The two cars were five and seven seconds off the pace in the rain of the first practice and although they were in better shape in the second practice, the team had both cars knocked out in second qualification 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.
It would have been touch and go if they had been able to improve and make it into the top 10.
If this season is not to be a total write-off, Mercedes need to get to the bottom of what is causing the car's problems quickly.
It wasn't a great session. The Briton told Sky Sports that he came here with optimism and everyone was working hard at the factory.
There are things we should have done. We will do everything we can to move up in the race.
It is what it is. Each weekend is a rescue.
Sainz crashed out of the Australian Grand Prix two weeks ago, after he made a mistake.
He said it was a shame. I was comfortable. I was not going at full speed. I apologize. The sprint race needs to come back as much as possible.