Nico Rosberg will start the German Grand Prix from pole position after edging his Mercedes team-mate Lewis Hamilton in qualifying.
The Mercedes duo once again went head-to-head in the battle for pole with Rosberg just coming out on top by 0.107s.
Rosberg was forced to abort his first flying lap due to an electronic glitch but came back to post a 1:14.363 on his only run to beat Hamilton.
“It was a great feeling. Not only was it one lap that I had (to do it) but I had extra fuel to make sure I had another shot,” said Rosberg.
Hamilton escaped a brief scare prior to qualifying when he was called to the stewards following an unsafe release in Practice 3.
Mercedes were found guilty with stewards handing the team a €10,000 Euro fine, while Hamilton avoided a reprimand.
Red Bull Racing's Daniel Ricciardo produced another impressive performance to claim third with the Australian just 0.3s slower than Rosberg.
“I think we got pretty close to be honest. My first lap in Q3 was really good and I knew there wasn't much more left on the table,” said Ricciardo.
“There was maybe a tenth or so in it with the perfect lap but not enough to challenge for pole.”
Red Bull completed a lock out of the second row with Max Verstappen a tenth slower than his team-mate.
Ferrari were comfortably beaten on pace by Red Bull as Kimi Raikkonen just edged his four-time world champion team-mate Sebastian Vettel for fifth.
Esteban Gutierrez just missed out on place in Q3 for Haas F1 in 11th ahead of McLaren's Jenson Button.
Carlos Sainz was 13th but faced an investigation after he appeared to impede Massa while the Williams driver was on a flying lap.
Fernando Alonso will head up the seventh row alongside Renault's Jolyon Palmer.
Romain Grosjean qualified in 15th spot but has been demoted to 20th following a gearbox change.
Meanwhile, Daniil Kvyat emerged as the biggest casualty of Q1 as he could only manage to secure 18th on the grid.
The Toro Rosso driver will start behind Renault's Kevin Magnussen and the Manor of Pascal Wehrlein.
Rio Haryanto (Manor), Felipe Nasr (Sauber) and Marcus Ericsson (Sauber) completed the grid.
Result: Formula 1 German Grand Prix Qualifying
|Q2 Gearbox Penalty