Toyota will start this weekend's 24 Hours of Le Mans from pole position after the Japanese manufacturer topped the third and final qualifying session on Thursday night.
Kamui Kobayashi's record-breaking time of 3:14.971s – set during the second session at dusk – held out as the fastest lap overall to put the #7 TS050 in front.
An early 3m 17.126s flyer from Kazuki Nakajima during the final set of runs elevated the sister machine in front of the #1 Porsche 919 Hybrid to ensure a front-row lockout.
The final margin between the top two cars was 2.227 seconds.
Kobayashi will share the #7 car with Mike Conway and Stéphane Sarrazin, while Nakajima drives the #8 alongside Anthony Davidson and Sébastien Buemi.
Porsche had a troubled run during Q3, with Brendon Hartley pulling the #2 919 to one side with overheating issues.
That rested the team's hopes on the #1 car, which lost valuable track time with a slow puncture.
Andre Lotterer mustered a best time of 3:17.259s, bringing Porsche to a tenth of a second shy of disrupting Toyota's lockout, but the German manufacturer couldn't quite beach the pace of the leading TS050s. Porsche's #2 entry will start this weekend's race fourth, ahead of the #9 TS050 which rounds out the LMP1 hybrid field.
The result means Toyota gets to celebrate its second pole position of the season, and a mirroring of its qualifying result at Le Mans in 2014 when it beat Porsche.
LMP2
In LMP2, G-Drive Racing will start from pole position thanks to a 3:25.352s submission by Alex Lynn.
The British driver's time lifted the TDS-run ORECA 07 from the midpack into provisional pole early in the final session, and was enough to seal the top spot by the close of play.
Second in class was Vitaly Petrov in the ORECA 07 prepared by Manor, four tenths off the precedent set by Lynn.
Oliver Jarvis qualified third for Jackie Chan DC Racing, ahead of the two Rebellion Racing entries.
The top nine places in LMP2 were occupied by ORECAs with the 'best of the rest' honour going to Mikhail Aleshin in the SMP Racing-entered Dallara P217.
GTE-Pro
Aston Martin will start from pole position in GTE-Pro, but the British squad's hopes of a front-row lockout were dashed by Ferrari driver James Calado, who jumped up to second in the final 10 minutes.
Calado's time was two tenths slower than the ultimate pole figure set by Darren Turner in the #97 Vantage, but was enough to edge out the sister Aston qualified by Richie Stanaway.
Stanaway had gone top with 23 minutes to go, but a late charge from the other side of the Aston Martin garage saw the order switch.
Sam Bird slotted the #71 Ferrari into fourth, ahead of the #69 Ford GT which shot to provisional pole after spending much of qualifying at the foot of the table.
Sixth and seventh were the fastest entries from Corvette and Porsche, respectively.
GTE-Am
The order was equally restless in GTE-Am, with numerous teams spending time in the provisional pole spot.
Ultimately it was Fernando Rees in the Labre Competition 'art-car' Corvette who prevailed, with the Brazilian registering a 3:52.843, four seconds quicker than last year's pole.
Initially, US Ferrari driver Bill Sweedler held sway after knocking the previously dominant #98 Aston Martin of Pedro Lamy off its perch.
A response from Lamy's team-mate Mathias Lauda restored the provisional result from earlier on Thursday, but didn't last long as former Aston Martin driver Rees charged through to snatch pole.
The Aston Martin squad duly settled for second, with Sweedler's time good enough for third and the #77 Proton Competition Porsche 911 RSR ensuring an eclectic top-four.