LE MANS, France -- Fernando Alonso has moved one step closing to completing motor racing's Triple Crown by helping to secure victory at the Le Mans 24 Hours with Toyota.

The second of the Spaniard's three race stints proved decisive, clawing back a large deficit to another Toyota team and bringing his No. 8 car back into contention after an earlier penalty. That helped propel Alonso and teammates Kazuki Nakajima and Sebastien Buemi into a lead they would not relinquish until the chequered flag on Sunday afternoon.

The win is hugely significant: for Alonso, it means he now just needs a victory at the Indy 500 to become the second driver in history to win that race, the Monaco Grand Prix and Le Mans; for Toyota, it ended its cursed history at Le Mans by finally securing a victory on its 19th attempt following a series of heartbreaking failures and near-misses over recent years.

Alonso, who will return to McLaren duty immediately at next weekend's French Grand Prix, becomes the second active F1 competitor to win the event in the past four years -- Nico Hulkenberg won it with Porsche in 2015 while contesting that year's F1 season with Force India.

The win is likely to intensify speculation about Alonso's future beyond 2018. His F1 deal expires this year and it remains unclear whether he will stay in the championship for another season. With McLaren weighing up an entry to IndyCar for next season, and its chances of providing Alonso a title-winning car in F1 all but zero, it looks increasingly likely Alonso might take on a full season in North America in order to properly prepare for an assault on the Indy 500 he debuted at last year.

Story of the race

Fernando Alonso put in an impressive stint in the Toyota overnight to contribute towards a team victory. JEAN-FRANCOIS MONIER/AFP/Getty Images

Despite all the attention in the build-up to the race around Alonso, fittingly it was Nakajima, the man who had earned the pole for the No. 8 car, who finished the race for Toyota on Sunday afternoon. The Japanese driver had been in the car for the same stint in 2016, when Toyota entered the final minutes of the race with a comfortable lead, only to hit a terminal car failure. He would pull up on the start-finish straight with just three minutes left, as Porsche snatched victory from Toyota in the most heartbreaking fashion imaginable.

The victory for the No. 8 car meant ex-F1 driver and Sky Sports pundit Anthony Davidson missed out on redemption with his two former teammates, having been moved aside for Alonso. The other Toyota, piloted by Kamui Kobayashi, Mike Conway and Jose Maria Lopez, finished second.

The No. 7 car had remained on the lead lap with the No. 8 and led for large spells on Saturday evening and into Sunday morning, but it fell out of contention when it hit a fuel issue and a slew of subsequent penalties in the final 90 minutes. Toyota's advantage was so big, the lead car finished a massive 12 laps ahead of the third-placed car, belonging to Rebellion Racing.

However, it was not a good race for all former F1 race winners making their first appearances at the race. Jenson Button's debut was a frustrating one -- an early sensor issue with the car prompted a lengthy stop early on, meaning it was already some 49 laps off the lead by the time he got his first laps in the evening. With Button signed up for the rest of WEC's "Super Season," it became a glorified test session for the 2009 world champion, a disappointing way for it to pan out given the clear excitement he had for the event earlier in the week.

The campaign will culminate at next year's Le Mans, meaning Button will have one more attempt at the prestigious race before the next regulation change. In the lower classes, Juan Pablo Montoya endured a tough first appearance at the circuit. The two-time Indy 500 winner would crash at the corner named after the host of his most famous victory, Indianapolis, late in the evening. Montoya's car was recovered and would finish fifth in the second class.

In the other car run by United Autosports -- the team owned by McLaren boss Zak Brown -- Paul di Resta crashed heavily at the Porsche Curves while challenging for an LMP2 podium position. The Scotsman walked away unscathed.

However, the LMP2 division would see a star appearance from one F1 alumni -- the G-Drive Racing team claimed victory thanks largely to the efforts of former Toro Rosso driver and current Formula E championship leader Jean-Eric Vergne. The Frenchman's electric opening stint propelled the car into a healthy lead it never relinquished.