World champion Fernando Alonso won a battle with Michael Schumacher for pole position at the European Grand Prix.
The Renault driver set a best lap of one minute 29.819 seconds to beat the Ferrari star by 0.209secs.
The two were well clear of Ferrari's Felipe Massa in third, with Honda's Rubens Barrichello in fourth.
Jenson Button had a disappointing run in his Honda and will line up sixth, beaten by team-mate Barrichello for the first time this year.
"It was a diffcult qualifying session. We just couldn't get a balance, which is not unusual for us around here," Button said.
"There's no excuses. We're just not on the same pace as the Ferraris and Renaults around here.
"I was struggling to get the tyres working on the first flying lap, which is unusual."
Alonso waited until virtually the last minute to push his Renault to its limits and take his first pole position of the season and the 10th of his career.
But the 24-year-old, who leads the championship by 15 points, was relieved to simply post a good time.
"Qualifying is always stressful and difficult because you cannot make any mistakes in the first two sessions or you are out," said Alonso.
"We made some changes to the car overnight and did a good job in qualifying. There were no problems for us."
There was, however, further disappointment for his team-mate Giancarlo Fisichella, who failed to make it through to the final qualifying session for the second race in a row.
The Italian will start in 11th spot and made a public display of his frustration after the race.
McLaren's Kimi Raikkonen used an upgraded V8 Mercedes engine for the first time in qualifying but could only finish down in fifth with 1:30.933.
The Finn led at the Nurburgring last season before he crashed out on the last lap but it seems likely that McLaren have opted to run with more fuel and try to thwart Renault and Ferrari's pace with tactics.
The qualifying sessions were fraught, especially after a technical fault with the official timing screens raised a red flag in error and caused the opening session to be delayed with three minutes to go.
But Schumacher is anticipating an exciting race in front of his home fans.
"The first run was not that clear and there were quite a few cars in front of me in the second," said the seven-time world champion.
"But I'm in the first row with a strong package, a good race pace and it should be interesting."
The Williams pair of Mark Webber and Nico Rosberg were not so lucky - both were handed 10-place penalites after their engines were changed before the sessions.
Webber's Cosworth engine developed a problem in practice and had to be replaced while Rosberg's car was fitted with a new unit as a precaution.
The punishment means Webber start in 22nd spot with Rosberg two spots further back.
Scotsman David Coulthard goes in 12th for Red Bull while Toyota's Ralf Schumacher starts his 150th Grand Prix back in 10th spot.
Cheesman
Troubled Webber starts 20th
MARK Webber put on a brave face after engine problems forced him and Williams teammate Nico Rosberg to start from the tail end of the grid for tonight's (AEST) European Grand Prix.
The pair will start on the final two rows, but are reasonably confident of adding to their current eight constructors's points and overtaking BMW Williams for fifth in the standings.
Webber suffered what the British team described as "unspecified engine problems" and was forced to change his powerplant after final practice.
He made it into the top-10 shootout, but will start 20th as a result of his penalty – his worst starting position of the year.
"I tried maybe to go a bit too hard on my last lap and made a little mistake at turn three, losing a bit of time, but I had nothing to lose," said Webber.
"I scraped into the top 10 when everybody else was running low fuel."
Germany teammate Rosberg also had his Cosworth engine changed ahead of qualifying as a precautionary measure, and will start last after dropping 10 places from his 12th spot in qualifying.