Lewis Hamilton took pole position for the Malaysian Grand Prix on Saturday, while Mercedes' run of nine straight front-row lockouts in Formula One came to an end as Ferrari's Sebastian Vettel qualified second.
A drenching thunderstorm delayed the final part of qualifying but even a wet track could not prevent Hamilton topping the grid with a time of 1 minute, 49.834 seconds at Sepang International Circuit.
Vettel was second, only seven hundredths of a second off Hamilton's time as Ferrari showed it could challenge Mercedes in Sunday's race.
Nico Rosberg was third for Mercedes while Red Bull driver Daniel Ricciardo qualified fourth ahead of his teammate Daniil Kvyat in fifth.
Toro Rosso's 17-year-old rookie Max Verstappen was an impressive sixth, while Williams put in a disappointing performance on the intermediate tires used in Q3. Felipe Massa qualified seventh and Valtteri Bottas in ninth.