KEY POINTS:
MAGNY-COURS, France - Felipe Massa put his resurgent Ferrari on pole position for the French Grand Prix on Sunday (NZ time), with McLaren's championship leader Lewis Hamilton right alongside.
"It's good to be back and fighting, it's good to be here," said the Brazilian after thwarting 22-year-old British rookie Hamilton's bid for a third pole in a row with his own fourth of the Formula One season.
Finland's Kimi Raikkonen will start Monday's race in third place for Ferrari, next to BMW Sauber's returning Polish driver Robert Kubica.
Hamilton's team mate and double world champion Fernando Alonso, who is 10 points behind Hamilton after seven races, qualified 10th.
Already sidelined for most of the day's final practice session due to a brake sensor problem, the Spaniard did not set a time in the final qualifying session due to a gearbox problem.
Alonso returned to the garage and sat in the car as mechanics worked around him in a race against time. With five minutes remaining, he stepped out and removed his helmet.
"You sit there and you wait for the miracle," said the Spaniard of his ordeal. "There's always hope until the last moment and you really believe that you will be able to do at least one lap.
"It is going to be extremely difficult tomorrow for me, starting 10th," he added. "I need points but I also know that more than fifth, sixth or seventh may not be possible. That is what I will try to do."
Massa's pole position, with a lap 0.070 seconds faster than Hamilton's best, was the seventh of his career.
It also confirmed Ferrari's return to form, with their retired seven-times world champion Michael Schumacher in attendance at the circuit where he won for a record eighth time last year.
"I would not say we are completely in front of our competitors but at least we are back and fighting," said Massa, 19 points behind Hamilton in the championship.
"We just have more grip and more consistency and the car is just behaving better."
Hamilton, winner of the last two races from pole position and chasing his eighth podium finish in a row, said he was confident there was still everything to play for.
"You can't be perfect all the time," said the Briton. "I had the car to be on pole but I lost a bit of time on turn 15. That's the way it goes.
"I believe we still have the pace of the Ferraris and we'll see what happens tomorrow."
Kubica, making a strong return to action after missing the last US Grand Prix following his big accident in Canada, was ahead of Renault pairing Giancarlo Fisichella and Heikki Kovalainen.
"This result shows we have made more good progress with the new parts we brought here," said Fisichella. "The gap to the leading teams has shrunk a little bit more."