The team had raced at Le Mans since 2012 with a very competitive vehicle, yet had never managed to score an outright victory.
The victory means that Alonso now has two of the three wins required for motor racing's unofficial Triple Crown comprised of Le Mans, the Monaco Grand Prix and the Indianapolis 500. Both cars ran reliably, with Alonso and his crew running second for much of the opening stint before the Spaniard delivered a stunning spell overnight to reduce the deficit, before Nakajima passed Kobayashi to seize a lead they would never relinquish.
But in a series of stints in the dead of night, Alonso clawed back the deficit and put the number eight auto right back on the tail of the number seven.
In LMP2, it was the G-Drive Racing machine of Roman Rusinov, Jean-Eric Vergne and Andrea Pizzitola that emerged victorious, taking victory in the second prototype class by an impressive two laps, beating the #36 Signatech Alpine Matmut vehicle of Nicolas Lapierre, Andre Negrao and Pierre Thiriet.
In the 16th hour of the race, Nakajima retook the lead and the number eight auto was in control for the duration.
Alonso shared the number eight Toyota TS050 hybrid with Swiss driver Sebastien Buemi and Japan's Kazuki Nakajima, who secured pole position and took the chequered flag.
The auto will form the base of a racer, set to compete in the just-announced "hypercar" class of the FIA World Endurance Championship when new regulations take force in 2020.
Do you think Trump will issue pardons after the Russian Federation probe ends?
Rudy Giuliani speaks at the Iran Freedom Convention for Human Rights and democracy in Washington, May 5, 2018. But Trump has seized on the report as fodder for his decision to fire Comey last May.
In an era when modern drivers tend to specialise in one category, such is the demand of the individual championships, that it would be a remarkable achievement for Alonso.
It just shows the effects of downforce and diffuser pressure as cars attain blistering speeds across the track.
A Toyota victory had been widely predicted after last year's champions Porsche withdrew from the 2018 edition.
Toyota's win is made all the more special after the team came within a lap of victory in 2016 only to have it taken away from them by reliability issues.
It was Toyota's first victory at the 20th attempt, and the first win for a Japanese manufacturer since Mazda's success in 1991.
But Toyota insisted that the two cars went into the race with equal chances of winning.
"I went there (the Indy 500) a year ago without any particular objective".