Lewis Hamilton only third as Nico Rosberg on Singapore Grand Prix pole position
Nico Rosberg took a stunning pole position at the Singapore Grand Prix as Lewis Hamilton was demoted to third by Red Bull's Daniel Ricciardo.
Hamilton was a massive 0.704 seconds slower than Rosberg after a difficult qualifying session, befitting what has been a troubled weekend throughout.
Red Bull's Max Verstappen took fourth ahead of Ferrari's Kimi Raikkonen.
The Finn's team-mate Sebastian Vettel will start last after a technical problem as Jenson Button starts 13th.
What happened to Hamilton?
Rosberg's was a remarkable performance - he has surely never been as superior to Hamilton when both have been gunning for pole.
For his part, Hamilton has looked out of sorts all weekend, missing half of the second practice session on Friday because of a technical problem and struggling to get a good lap in before that.
He failed again to do a qualifying simulation lap in Saturday's final practice session, locking his brakes heavily and going straight on at Turn Seven.
First qualifying went better for Hamilton - he was fourth quickest, 0.15secs quicker than Rosberg but the German was faster in the second session, again on the first runs in the top 10 shoot-out and then he made a mistake on the entry to Turn One on his final lap.
It was in some ways reminiscent of Hamilton's weekend at the European Grand Prix in Baku in June, when he crashed out of qualifying and lined up 10th.
However, it later emerged that his car may have had a problem - Mercedes' data was showing it was producing less aerodynamic downforce than Rosberg's, which would explain the lack of grip.
At least this time he starts close to the front, but unless Rosberg makes a poor start - a Mercedes weakness at times this season - Hamilton will find it difficult to beat his team-mate, whom he leads by two points in the championship.
"Definitely happy with that one," said Rosberg. "For sure one of my top three laps ever. At times it wasn't clear where we would stack up against Red Bull so I knew I had to pull one out of the bag."
Hamilton said: "It has not been my weekend so far. Not many good laps. Just not been able to string them together."
A threat from Red Bull
Ricciardo's superb performance - 0.531secs behind Rosberg and 0.213secs quicker than Verstappen - gives him a strong chance to fight for victory, after he pipped Hamilton with his last lap of the session.
Red Bull had better pace on the race simulation practice runs on Friday than Mercedes, and Ricciardo and Verstappen will start the race on the super-soft tyre rather than the ultra-soft Mercedes will use.
It remains to be seen which strategy is advantageous - Red Bull will be able to do a longer first stint, but Mercedes then have two sets of softs available for remainder of the race while Red Bull only have one.
Oh, Ferrari, not again
Hamilton at least did better than Vettel, who hit trouble almost as soon as he left the pits. He radioed the team to say he felt something wrong at the front of the car but was told to stay out and try to do a lap.
But he was not able to do a time quick enough to get him through into second qualifying and he said over the radio: "This is stupid, we are losing time."
The team said that the problem was a broken rear anti-roll bar. Vettel added: "There was no time to fix it. I wanted to come in but we decided to stay out."
Bad luck for Button
The top 10 was completed by the impressive Toro Rossos of Carlos Sainz and Daniil Kvyat, with McLaren's Fernando Alonso in ninth, splitting the Force Indias of Nico Hulkenberg and Sergio Perez.
However, race stewards penalised Perez a total of eight grid positions for offences committed while yellow caution flags were out during second qualifying.
He was dropped three places for passing Haas driver Esteban Gutierrez and a further five for not slowing sufficiently for the flags, dropping him to 18th on the grid.
Perez was also given three penalty points on his licence.
The yellow flags were out after a crash by McLaren driver Jenson Button.
The 2009 world champion had looked stronger in qualifying after struggling throughout practice but qualified 13th after hitting the wall in Turn 14 and breaking a wheel on his final lap.
"I tapped the wall with the left rear," said Button, who may be taking part in Singapore for the last time after deciding not to drive in 2017, with no certainty about his future beyond that.
"I didn't think I hit it that hard but it broke the wheel and I got a puncture.
"It has been a tough weekend for me. I hadn't found the pace in the car and Fernando had. Then I got to qualifying and I found it but there you go."
Jolyon Palmer will line up 19th in his Renault, two places and 0.135secs behind team-mate Kevin Magnussen.