Vettel pips Alonso to pole
"We knew that it would be close, but did not expect it to be that close, it's not very comfortable," said Vettel, who now has 11 poles in his career. "It would be interesting to see just how much it is, two thousandths of a second."
Felipe Massa of Brazil in the second Ferrari was third and Mark Webber of Australia was fourth in another Red Bull to complete the two front rows for today's German Grand Prix.
Championship leader Lewis Hamilton of Britain was sixth, behind McLaren teammate Jenson Button.
Vettel will be looking for his third win of the season.
"There are no points to be won Saturday, the main challenge will come tomorrow," Vettel said.
Alonso won the opening race of the season in Bahrain but Ferrari has since fallen behind the Red Bulls and the McLarens.
"Finally we got close to the Red Bulls, after ten races," Alonso said. "We are in the front row for the first time and we lost the pole by a small margin but that's not important.
"We are going in the right direction. Finally we did 100 percent in qualifying and for the first time we have two Ferraris in the top three.
"This is a massive step for Ferrari, with both of us in the top three and this is the way we have to keep going."
Massa said he felt he might have lost some fractions by being too cautious. "It's good to start in the top three. I am optimistic, the car feels competitive."
Ferrari has had a good weekend so far, with Alonso faster than Vettel in Friday's practice and just behind the German in the third practice session before qualifying.
Vettel's fastest lap on the 4.6-kilometer (2.8-mile) Hockenheimring circuit was 1 minute, 13.791 seconds. Alonso clocked 1:13.703 and Massa drove 1:14.290. Webber timed 1:14.347.
Vettel said the Ferrari cars have been "very competitive" in the first two days. "We have a very strong car, but we are very close to the Ferraris," he said. "We start in the best position and we'll go to sleep with a good feeling but we'll have to confirm it tomorrow."
Webber, coming off his victory at the British Grand Prix two weeks ago, made a mistake at the start of his final lap and abandoned the last chance to improve his time.
"It was a shame I couldn't take advantage of the improved track conditions at the end of the session," Webber said.
Michael Schumacher, who won four times in Hockenheim, qualified in 11th place in his homecoming. The seven-time Formula One champion is in his comeback season after coming out of retirement.
Schumacher was knocked out of the top ten in the final moments of the second qualifying session by the Williams of Nico Hulkenberg, one of six German drivers in the 24-man field.
"There isn't much more to say about qualifying other than the result was what was achievable for us today. Clearly it was disappointing because we had expected to be able to fight for fifth or sixth place," Schumacher said.
"If I want to find something positive, it is that at least I will be starting from the better side of the grid and in the end.
"I prefer 11th to 10th place because of that," he said.
The first qualifying session was interrupted after the crash of the Force India driven by Tonio Liuzzi. The Italian driver was not hurt. He went wide on a wet patch exiting the last corner and crashed into a wall. The track later dried out.
Brazilian driver Lucas di Grassi's Virgin had an electrical problem before he could complete a timed lap. Di Grassi's German teammate Timo Glock, who had the 20th fastest time, also required a new gear box and will be dropped to start in the last row alongside de Grassi.
Adrian Sutil of Germany, who was 14th, will also drop five places on the starting grid because his Force India required a new gear box.