Toyota took provisional pole position for the Le Mans 24 Hours courtesy of a last-gasp lap from Kazuki Nakajima in a thrilling conclusion to an incident-filled second qualifying session.

Nakajima underlined the Toyota TS040 Hyrbid’s status as pre-race favourite by clinching top spot ahead of tonight’s final part of qualifying, but Porsche’s pair of 919 Hybrids pushed the Japanese manufacturer hard.

A late flier from Timo Bernhard looked set to consolidate the #20’s position at the top of the times until Nakajima twice improved late on.

With five minutes remaining, the Japanese split the two Porsches to lift Toyota onto the front row, and then eclipsed Bernhard’s 3m22.908s by more than three-tenths of a second.

Romain Dumas then took second in the #14 Porsche, putting it ahead of its sister car but falling just 0.119s short of wresting back provisional pole from Toyota.

Oliver Jarvis was another to go faster right at the end of the session, putting the #3 Audi R18 e-tron quattro fourth.

It means the lead quartet comprises one of each of the three manufacturers and is covered by 0.7s going into the final part of qualifying, which has been extended by half an hour and will now start at 2130 local time.

That is because of a pair of red flag interruptions, the second of which came just after the #1 Audi – rebuilt following Loic Duval’s huge crash in practice – was involved in a pair of accidents.

Lucas di Grassi had just gone seventh when he spun exiting Indianapolis and hit the left-hand side barrier, damaging his repaired Audi’s front end.

He was able to continue, slowly, but on his way back to the pits inadvertently caused a huge crash for the #29 Pegasus Morgan-Nissan.

Leo Roussel attempted to pass di Grassi at speed approaching the Ford chicane, but took to the grass to avoid the Audi as it jinked left. He spun and speared across the track, slamming hard into the barrier.

Both drivers were summoned to race control over the incident.

That accident, which unsurprisingly brought out the red flags as it came to a halt just by the entry to the pitlane, capped a chaotic couple of minutes.

In addition to di Grassi’s own spin, the #79 ProSpeed Porsche drive by Bret Curtis spun on the approach to the Dunlop chicane and hit the tyre barriers.

The #46 TDS Racing Ligier-Nissan took provisional LMP2 pole courtesy of Tristan Gommendy.

The Frenchman’s 3m38.094s just shaded the #48 Murphy ORECA-Nissan, in which Nathanael Berthon had earlier gone fastest.

The #36 Signatech ORECA is now third, having also held top spot by bumping Wednesday night’s pacesetting LMP2 outfit, the #26 OAK Racing Morgan-Nissan, which fell to fourth.

Ferraris still lead the way in both GT divisions. Gianmaria Bruni’s 3m54.754s remains good enough to have the #51 AF Corse Ferrari 458 Italia on provisional Pro pole, but its closest challenger is now the #73 Chevrolet Corvette.

Jan Magnussen was a steady improver in the new-for-2014 CR.7, and he pushed the #97 Aston Martin Racing entry into third with a late effort that shade the sole Vantage’s best by 0.029s.

It was a less successful session for the #71 AF Corse Ferrari, in which James Calado had caused the first of the session’s two red flags when he crashed at the Porsche Curves.

The SMP Ferrari remains on GTE Am pole, just ahead of the #81 AF entry.