Jorge Martin made history as he claimed his second pole of the MotoGP season, which resumed at the Styrian Grand Prix on Saturday.

The Pramac Racing rider's winning time of 1:22.994 was the fastest recorded at the Red Bull Ring in Spielberg, as he finished 0.044s ahead of Francesco Bagnaia.

There was drama as Martin's effort was almost eclipsed by Fabio Quartararo, only for the runaway championship leader to exceed track limits by drifting into the green at the vital moment.

MotoGP debutant Martin made a strong start to his maiden campaign; taking pole in Doha in round two on the way to an impressive third-place finish.

However, injury during qualifying at the Portuguese Grand Prix two weeks later ruled him out of four races, while he was also forced to retire at the Dutch TT last time out.

Nevertheless, the 23-year-old has demonstrated brilliant determination to bounce back and finish fastest in qualifying, which he dedicated to his currently hospitalised grandfather.

"It wasn't the perfect lap," he said. "I started quite well in the first sector.

"I kept pushing and saw I was coming in hot, but then I made a mistake with the gearbox in corners four and five.

"In the last two corners, I tried my best not to go to the green because with the wind, it was difficult. When I finished the lap and saw the time on my screen, I thought: 'that's a good time.'

"I want to dedicate this pole position to my grandfather. He's in hospital and he's battling a lot."

Despite missing out on a sixth pole of the season, Quartararo will begin Sunday's Grand Prix on the front row of the grid for Monster Energy Yamaha.

"It's a shame because of the track limit. I did the maximum with what I had," said the Frenchman, who is currently 34 points clear at the top of the riders' standings.

"Sunday, it looks like it's going to rain, so it's good to have a great position on the grid.

"I pushed my bike to the limit. I will not say it's my best lap because I made many mistakes, but it's the first time that I've pushed that much on a bike."

It was a good day for Ducati with Martin and Bagnaia first and second with Jack Miller and Johann Zarco, who finished fourth and sixth respectively, not far behind.

World champion Joan Mir will start fifth for Suzuki Ecstar.

Meanwhile, seven-time MotoGP champion Valentino Rossi, who announced earlier this week that he would retire at the end of this season, was 17th.

Provisional classification

1. Jorge Martin (Pramac Racing) 1:22.994
2. Francesco Bagnaia (Ducati) +0.044s
3. Fabio Quartararo (Monster Energy Yamaha) +0.081s
4. Jack Miller (Ducati) +0.306s
5. Joan Mir (Suzuki Ecstar) +0.328s
6. Johann Zarco (Pramac Racing) +0.382s
7. Alex Espargaro (Aprilia) +0.454s
8. Marc Marquez (Repsol Honda) +0.495s
9. Maverick Vinales (Monster Energy Yamaha) +0.514s
10. Takaaki Nakagami (LCR Honda) +0.542s
11. Alex Marquez (LCR Honda) +0.847s
12. Miguel Oliveira (Red Bull KTM) +0.950s