Valtteri Bottas clinched pole position for the Brazilian GP in a qualifying session where his team-mate Lewis Hamilton crashed out in Q1.
The British racer was one of the first out on what was a slightly slippery track given a bit of earlier drizzle.
He lost control midway through Turn Six, the car got away from him, and he landed up left side in the barrier.
The session was red flagged as the marshals cleared the debris, including his W08.
With Hamilton out of qualifying it was left to Valtteri Bottas to fly the flag for Mercedes, who had set the pace in all three practice sessions including a P1 for Bottas in FP3.
The Finn, though, was made to work hard by Ferrari.
While Kimi Raikkonen was quickest in Q1, it was Sebastian Vettel who set the pace in the second segment with a new lap record of 1:08.494.
Vettel continued with his record-breaking pace as Q3 got underway with the German clocking a 1:08.360 to hold provisional pole by 0.082s over Bottas. Raikkonen was third, 0.407s.
With the rain coming down a bit heavier in the final four minutes of Q3, and the track temperature dropping, Vettel was unable to better his time, opening the door for Bottas.
The Mercedes driver did it, taking pole by 0.038s with a lap record of 1:08.322. Vettel was second.
Raikkonen was third ahead of Max Verstappen while Daniel Ricciardo qualified P5 but will start further down the order due to an engine penalty.
Sergio Perez was P6 on the day but will start fifth ahead of Fernando Alonso, Nico Hulkenberg and Carlos Sainz.
Felipe Massa was last in the shoot-out.
1 Valtteri Bottas Mercedes 1:08.322
2 Sebastian Vettel Ferrari 1:08.360 0.038
3 Kimi Raikkonen Ferrari 1:08.538 0.216
4 Max Verstappen Red Bull 1:08.925 0.603
5 Daniel Ricciardo Red Bull 1:09.330 1.008
6 Sergio Perez Force India 1:09.598 1.276
7 Fernando Alonso McLaren 1:09.617 1.295
8 Nico Hulkenberg Renault Sport 1:09.703 1.381
9 Carlos Sainz Renault Sport 1:09.805 1.483
10 Felipe Massa Williams 1:09.841 1.519
11 Esteban Ocon Force India 1:09.830
12 Romain Grosjean Haas 1:09.879
13 Stoffel Vandoorne McLaren 1:10.116
14 Kevin Magnussen Haas 1:10.154
15 Brendon Hartley Toro Rosso
16 Pascal Wehrlein Sauber 1:10.678
17 Pierre Gasly Toro Rosso 1:10.686
18 Lance Stroll Williams 1:10.776
19 Marcus Ericsson Sauber 1:10.875
20 Lewis Hamilton Mercedes