Fernando Alonso won Le Mans 24 Hours at the first attempt as he and team-mates Sebastien Buemi and Kazuki Nakajima finally ended Toyota's long drought.
Toyota had never won the sportscar race despite years of trying but finally delivered in an event in which they were effectively without opposition.
Alonso's victory completes the second part of motorsport's 'triple crown' for the two-time Formula 1 world champion.
Twice a Monaco Grand Prix winner, he now wants to win the Indianapolis 500.
Only Englishman Graham Hill has won all three classic races in the entire history of motorsport.
Alonso joined Toyota's World Endurance Championship (WEC) programme this season with the aim of winning Le Mans, and is dovetailing it with his programme with McLaren in Formula 1.
Toyota are the only team competing with a hybrid car in the top LMP1 class, and the privateer-run non-hybrids are not fast enough to challenge them.
The presence of a sporting icon at Le Mans guaranteed the race, Toyota and the WEC far greater international attention than had it been six lesser-known drivers competing in what was effectively a private Toyota battle.
Nakajima - who, like Buemi, is a former F1 driver - put Alonso's number eight car on pole position and the lead see-sawed between it and the number seven machine shared by Briton Mike Conway, Japanese Kamui Kobayashi and Argentine Jose Maria Lopez for much of the first half of the race.
The advantage seemed to have swung to the number seven car when Buemi was penalised with a 60-second stop-and-go penalty for speeding in a caution zone shortly after night fell on Saturday.
That put Alonso's number eight car more than two minutes - two thirds of a lap - behind and apparently facing an uphill struggle to get back into contention.
But in a series of stints in the dead of night, Alonso clawed back the deficit and put the number eight car right back on the tail of the number seven.
In the 16th hour of the race, Nakajima retook the lead and the number eight car was in control for the duration.
However, there were still scares that provided reminders of Toyota's failure to deliver a victory in previous years - most famously when their car broke down while leading on the final lap two years ago.
Toyota escaped a penalty when the number eight car's wheels were seen to be moving before it had touched the ground, which is not permitted, during the pit stop when Alonso handed the car to Nakajima for the final two stints before the finish.
And Kobayashi missed a pit stop in the penultimate hour and had to complete much of a lap on electrical power alone because he did not have enough fuel.
But in the end, both cars made it to the finish, to complete the company's dream result - a one-two, with Alonso's car the victor.
Jenson Button, the 2009 F1 world champion, was competing in the non-hybrid LMP1 class for the Russian SMP team.
His car was out of contention early on after spending two hours in the pits with an engine problem. It rejoined the race but retired with engine failure during the final hour.
Analysis - back to Indy for Alonso?
Fernando Alonso has long been regarded as one of the all-time great racing drivers and the best along with Lewis Hamilton in the current era of F1, but he has found success hard to come by in grands prix in recent years.
The Spaniard left Ferrari at the end of 2014 having lost faith in their ability to deliver a title-winning car, only to find that McLaren-Honda were in far worse shape.
Three years of poor reliability and performance, and an apparent lack of interest in signing the ageing champion from the top three teams, broadened his outlook beyond F1.
The 36-year-old's ambition has become to win motorsport's famous 'triple crown' and he competed at Indianapolis last year, impressing the regulars by running competitively and being in with a chance of victory until his engine failed in the closing stages.
This year, he sought permission from McLaren to dovetail his F1 programme with an attempt to win Le Mans, which became an entry in the entire World Endurance Championship.
His car went in to Le Mans as strong favourite and the classic event has now been ticked off in clinical style.
There have been questions about whether it was a demonstration rather than a race, because of the obvious promotional benefits for all involved if Alonso won.
But Toyota insisted that the two cars went into the race with equal chances of winning.
If it was a genuine fight, at least for the first two-thirds of the race, Alonso's apparently impressive multiple stints in the middle of the night, when he closed a two-minute lead to virtually nothing, will come to be seen as playing a decisive role in the victory for the number eight car.
Either way, the win is likely only to enhance his status as one of motorsport's iconic historical figures.
Can Alonso now win Indianapolis? Will he stop F1 at the end of this year to focus on Indycar totally, or stay in F1 and just do the Indy 500 again next year, as he did in 2017?
These questions will be hanging over him when he returns to his F1 role with McLaren at next weekend's French Grand Prix.