Red Bull's Max Verstappen beat Ferrari's Charles Leclerc to pole position in a rain-affected qualifying session at the Sao Paulo Grand Prix.
Aston Martin's Lance Stroll and Fernando Alonso took third and fourth, benefitting from approaching rain.
The track stayed dry for every driver's first lap in the final session but Leclerc described conditions as "super-weird" as the wind shifted direction.
Mercedes' Lewis Hamilton was fifth and George Russell will start eighth.
Russell qualified right behind Mercedes team-mate Hamilton but was given a two-place grid penalty for impeding Alpine's Pierre Gasly while leaving the pits. That promoted McLaren's Lando Norris to sixth and Ferrari's Carlos Sainz to seventh.
Gasly and his team-mate Esteban Ocon, who qualified 13th and 12th, were both also found guilty of the same offence and given the same penalty.
Red Bull's Sergio Perez, under pressure after a series of shaky races, was ninth, unlucky to be behind McLaren's Oscar Piastri on track when the Australian spun at Juncao, the corner on to the pit straight.
The Mexican, under pressure after a series of shaky races, suffered because he was one of the last drivers out of the pits and Norris' team-mate Oscar Piastri spun at the final corner on to the pit straight in front of him, forcing the Red Bull driver to back off.
Other than Piastri, all the drivers in the top 10 managed a lap on a dry track before the rain hit, but they were all considerably slower than in the previous session.
Verstappen, who beat Leclerc by 0.294 seconds, said: "The gaps were very small between everyone. Q1, Q2, you could see everyone was using a lot of tyre sets. It made it quite interesting.
"We lined up for Q3 and you could see the sky was just black. I was like: 'Well, if that rain hits, it is going to be a lot.'
"We went for the lap. The first sector felt all right and the rest felt shocking. The rain was coming in. It was not hitting the track yet but the wind increased a lot and changed direction to a tailwind in the middle sector.
"I was shouting on the radio saying: 'What the hell happened?' We were nowhere, but the team said everyone was struggling. I have never seen such an influence on car balance."
Leclerc added: "I've never experienced that in my career before. It felt like it was raining but there was no rain around.
"The wind change was crazy. There was just no grip from sector two onwards, which was extremely confusing because you had no idea where the balance would be at the corner you were approaching.
"At the end of the lap, I thought: 'This is not good enough, I am P10 for sure.' But luckily I wasn't."
Heavy rain did then start to fall, accompanied shortly afterwards by an electric storm, and the session was red-flagged with four minutes remaining, officials deciding not to restart it.
"It's night time," Alonso said, as the drivers returned to the pits.
The heavy rain caused damage at the track, with photographers reporting that a grandstand roof had collapsed at the last corner. Two hours after the end of qualifying, organisers said there had been "a handful of very minor incidents but nothing serious at this time".
On the track, Norris felt he had missed out on an opportunity to start right at the front.
"The car was amazing," he said. "Easily probably quick enough to be quickest and on pole. Delivering the lap and putting it together in Q3 is a different job. So pretty gutted it went the way it did."
For Stroll, it was by far his best qualifying result of the season as he beat Alonso by just 0.043secs, out-qualifying his illustrious team-mate for only the third time all season.
The Canadian, who was competitive throughout the session, said: "The car was feeling good throughout the whole session. My lap was super-messy in Q3 but good enough for top three. It was definitely a much better day than we've had in a while.
"I don't think we are third on paper. The conditions in Q3 were a little funny and we managed to execute well."
It was a strong result and something of a relief for Aston Martin, whose form has slumped in recent races after a strong start to the season.
Stroll felt they had benefited from being the first two cars out on track at the start of the final session.
"We did well going early at the front of the queue and getting in our lap early before the rain came," he said. "I know a lot of people didn't get clean laps. The points are on Sunday but it's still a huge step from Mexico, Austin. It is the best qualifying pace we have had in a long time."
The changing conditions were typical of Brazil, where rain has often affected events at Sao Paulo's Interlagos circuit, a historic and charismatic venue which it was announced on Friday will be on the calendar until at least 2030 thanks to a new contract.
Ironically, a 15-minute delay to the start of the session, caused by the need to clear the track of dirt and debris, ensured the rain hit the session.
Without that, the whole hour would have been managed before the rain began to fall.
Do motion sickness remedies work? Greg Foot gets queasy in the name of science to find out
What was it like onboard the hijacked Nigerian Airways flight? A passenger recounts the terrifying journey in 1993