Highlights - Malaysian GP qualifying
Red Bull's Mark Webber overcame hazardous wet weather to take pole position for the Malaysian Grand Prix.
The Australian switched from wet tyres to intermediates in drying conditions for the top-10 shootout to post a lap 1.3 seconds clear of the field.
Mercedes' Nico Rosberg was second ahead of Webber's team-mate Sebastian Vettel.
Ferrari and McLaren misjudged the weather so Jenson Button, Fernando Alonso, Lewis Hamilton and Felipe Massa will line up 17th, 19th, 20th and 21st.
With rain beginning to fall in the first qualifying session, they stayed in the pits to monitor the conditions while their rivals posted quick times on a track that was still fairly dry.
It proved a costly mistake because the rain persisted and track conditions were even worse by the time they came out to post times.
Webber later posted a flying lap of one minute 51.886 seconds, which brought a thrilling climax to an intoxicating qualifying session and secured Red Bull their third pole position in as many grands prix this season.
"It was a very tricky qualifying session for everyone," said Webber after securing his first pole of the season. "There was a lot of standing water and it was hard to get a clear lap it was very challenging.
"The pole is for Ciaron Pilbeam, my engineer; he made the call for the inters. It was tricky in places but I kept it on the black stuff and got the job done."
Rosberg finished in second and Webber's team-mate Sebastian Vettel, who took pole in Bahrain and Australia, was a further 1.16secs back. "For Webber to go out straight away on intermediates was very risky, very impressive and a great decision," said Rosberg.
Webber praises engineer's judgement
There was a hugely encouraging performance from Force India's Adrian Sutil as the German was fourth-fastest, and highly-rated Williams rookie Nico Hulkenberg took fifth.
But seven-time world champion Michael Schumacher struggled for pace once again and was forced to settled for eighth, more than two seconds adrift of the quickest lap.
It was an outstanding run by Webber, who also bounced back from engine failure in Friday's second practice session to top the timesheets during third practice on Saturday.
The rain had been expected to arrive during qualifying and it did just that when sunny skies made way for heavy cloud cover and the heavens opened about 10 minutes before the first qualifying session was due to start.
Robert Kubica swiftly set the fastest lap - 1:46.283secs - and no-one else could get close to that time as the track became increasingly difficult to handle.
We made the wrong call - Button
Torro Rosso's Sebastien Buemi, Vitantonio Liuzzi of Force India and Hispania's Bruno Senna were among those to lose control.
By that point the big guns were struggling dearly and McLaren's Hamilton spun to a standstill, his team-mate Button aquaplaned at Turn 6 before failing to make it out of from the gravel, and Ferrari's Massa slid off.
Button was still in position to reach the second qualifying session but because was prevented from contesting it because he failed to return to the track after his spin.
"We didn't think we had to go out early; we thought that was the only rain storm," said the reigning world champion.
"We just didn't expect the rain. It is very frustrating. The negatives are that I am a long way back on the grid in terms of the Red Bulls but I am in front of three of my rivals so that is a positive.
"We made a wrong call so there is not much we can do, but it could be worse. We can certainly make a race of it though, this is exactly what Formula 1 wants, so it should be good tomorrow."
Confidence is still high - Alonso
The remaining cars came in for full wet tyres but the damage had already been done and Massa, team-mate and championship leader Alonso, and Hamilton could not make it through to the second qualifying session.
That offered many of the lesser teams a rare opportunity and Hulkenberg and Sutil both posted fastest laps, likewise Schumacher, Kubica and Vettel.
It was a gripping session that saw positions switching hands at a rate of knots and, although Vettel held on to top spot, Schumacher only scraped into the top-10 shootout after finishing 10th fastest.
With the rain continuing to lash down, the final session was stopped before a time had been recorded but when the top 10 returned to the track it had dried somewhat.
That was when Webber and engineer Pilbeam made their inspired decision and the 33-year-old never looked back.
At one stage Vettel had looked to have snatched pole from his team-mate but Webber produced a scintillating hot lap to secure his place at the head of the grid.
Forecasts suggest thunderstorms could arrive during Sunday's race but Webber has put himself in prime position for a first victory since the 2009 Brazilian Grand Prix last October.