This year's Le Mans finish was worthy of an audience-grabbing blockbuster

The 84th edition of the 24 Hours of Le Mans was one of the most memorable to date. Porsche earned its 18th overall win at the event, but getting to the top spot of the podium was easier said than done — and it required a little bit of luck.

Toyota began leading both the LMP1 class and the overall race early on. Its TS050 — which uses a 2.4-liter V6 engine and a powerful electric motor — was sharp, fast, and more efficient than the Porsche 919 Hybrid and the Audi R18, its main rivals. The 919 and the TS050 took turns leading the race overnight, but as the end neared it seemed like nothing could stop Toyota from snatching its first-ever Le Mans win.

In the pits, the Toyota team was ecstatic, while members of the Porsche team watched the end of the race with somber faces because they knew the No. 2 919 was running over a minute behind. Toyota was about to become the second Japanese company to win the 24 Hours of Le Mans. Then, with less than four minutes to go in the race, the No. 5 car that was poised to win suddenly lost power and stopped.

The TS050 eventually restarted, but it had lost its lead to Porsche. To add insult to injury, it wasn’t able to complete its last lap in under six minutes so it was automatically disqualified. Toyota still hasn’t shed insight on what brought the No. 5 car to a halt.

The breakdown took the team by complete surprise.

“I don’t know what happened — I thought he was waiting for me and I would stay behind him to the finish. Then I was told he had a problem and I had to overtake him. This is racing at Le Mans, but it’s so sad to end like this,” said Stéphane Sarrazin, one of the drivers of the No. 6 TS050, in an interview with AutoSport.

Second place went to the No. 6 Toyota, and the breakdown allowed Audi — whose two R18 racers had run a particularly troublesome race — to secure the third spot on the podium. The Porsche team gave Toyota an ovation after the race.

The race was much brighter for Ford, which made a long-awaited return to Le Mans after decades of absence. Designed specifically for the Le Mans track, the GT got off to a rough start, but it made a spectacular — and unexpected — comeback. During most of the race the No. 68 GT fought head-to-head against No. 82, a Ferrari 488 GTE, for domination of the LMGTE Pro class.

Read more: How tech helps Le Mans racers drive faster, last longer, and use less gas

The gap separating the two cars was so small at times that it was impossible to predict who would take first in class. The Ford raced ahead of its rival with about three hours left to go in the race, and its lead got a lot more comfortable when the Ferrari spun out. The GT won first in class (and 18th overall), exactly 50 years after a Ford GT40 took first overall at Le Mans.

“The race was incredible. We had to fight all the way. It was probably one of the best tussles this class has ever seen,” said Sébastien Bourdais, one of the drivers of the winning GT.