The Formula One world championship leader Nico Rosberg has taken pole position for the Hungarian Grand Prix while his Mercedes team mate and closest rival Lewis Hamilton saw his hopes go up in flames.
Hamilton, 14 points behind Rosberg after 10 races, has won in Hungary for the past two years and was the favourite for pole after setting the pace in practice.
Instead, the Briton is set to start last and from the pitlane after his car caught fire with the qualifying session barely started.
Red Bull's quadruple world champion Sebastian Vettel qualified second, equalling his best grid placing of the season.
Finland's Valtteri Bottas starts third for Williams with Australian Daniel Ricciardo fourth for Red Bull.
While Hamilton's blaze, caused by a suspected fuel leak, was the main talking point, there were other shocks in an eventful session that ended with Mercedes' 10th pole in 11 races.
Frenchman Jules Bianchi, a Ferrari academy driver who races for struggling Marussia, qualified 16th and ahead of Ferrari's 2007 champion Kimi Raikkonen at one of the Finn's strongest circuits.
Ferrari had mistakenly assumed both their drivers were safely through the first phase of qualifying and did not send them out for second runs.
Raikkonen's double world champion team mate Fernando Alonso will start fifth.