Valentino Rossi has taken pole position for the German Grand Prix after snatching the top spot from Fiat Yamaha team-mate, and title rival, Jorge Lorenzo on his very last lap at a soaking wet Sachsenring.

After a wet/dry Friday practice and dry Saturday morning session, there was no doubt about which tyres were needed for the afternoon hour - with rain pummelling the tight and twisty circuit from start to finish.

The rain got heavier during the second half of the session, slowing the rate of improvements, but Rossi was nevertheless able to topple Lorenzo with 14 minutes remaining.

Lorenzo, riding with a separated shoulder and fractured bone in his foot from Laguna Seca, then struck back with seven minutes to go.

The factory M1 riders, separated by just 0.025sec on track and nine points at the top of the championship, ignored the conditions to slog it out for supremacy while others - including third on the grid Casey Stoner - chose to sit out the closing minutes.

Lorenzo looked like he might have done enough, but Rossi raised himself to new levels on his final lap to gouge a massive 0.640sec from Lorenzo's best time, handing the reigning six time MotoGP world champion his third pole position of the season.

A cautious Stoner was a further 0.6sec behind for Ducati Marlboro, but will hope that his energy-saving qualifying session will allow him to fight harder and longer in the race, as he seeks to close a 16 point gap to Rossi.

Heading row two after an especially eventful session will be Stoner's team-mate Nicky Hayden. The American, fourth in dry morning practice, had a problematic start to the afternoon - sitting 17th and last after 15 minutes - then made rapid progress to reach fourth with a quarter of an hour to go.

But as the 2006 world champion pushed for a front row with six minutes remaining, he became the last in a long line of riders to fall at turn eight, a fast downhill left hander.

Hayden highsided from his Desmosedici, throwing him into the air before he slammed shoulder-first into the side of Niccolo Canepa, bringing the Italian rookie down with him. Hayden walked away, while Canepa required a stretcher but is thought to be okay.

Others to fall at the same corner were Randy de Puniet, Marco Melandri, Toni Elias, Alex de Angelis and Loris Capirossi. All walked away, but the riderless RC212Vs of Gresini team-mates Elias and de Angelis sustained heavy damage as they remained on two-wheels through the gravel and rammed the airfence at high speed.

Joining Hayden on row two will be satellite Honda riders de Angelis and de Puniet, as Hayden and de Angelis enjoyed their best qualifying of the season so far.

Top satellite rider in the world championship, Colin Edwards, will start from seventh position while US GP winner Dani Pedrosa - who crashed out of the race and world championship lead in the wet at last year's event - was only eighth for Repsol Honda. Team-mate Andrea Dovizioso looked even less comfortable on his way to eleventh.

Capirossi will line-up ninth for Rizla Suzuki with Pramac Ducati rookie Mika Kallio tenth despite his finger injury. Chris Vermeulen also fought pain, from his Friday highside, to claim eleventh.

Melandri (13th), Canepa (15th) and Elias (17th) suffered due to their accidents, while James Toseland stayed on two wheels on his way to a disappointing 14th for Tech 3 Yamaha. Rookie Gabor Talmacsi featured in the top ten on several occasions before dropping to 16th for Scot Honda.

The MotoGP grid has been reduced to 17 permanent riders from Germany onwards, following the departure of the Grupo Francisco Hernando team, which had been running Sete Gibernau.

Mixed weather conditions are forecast for race day.

Qualifying:

1. Rossi
2. Lorenzo
3. Stoner
4. Hayden
5. de Angelis
6. de Puniet
7. Edwards
8. Pedrosa
9. Capirossi
10. Kallio
11. Dovizioso
12. Vermeulen
13. Melandri
14. Toseland
15. Canepa
16. Talmacsi
17. Elias