Fernando Alonso will compete in the World Endurance Championship alongside his Formula One commitments in 2018 and make his debut in the 24 Hours of Le Mans.
McLaren have struck a deal with Alonso and Toyota Gazoo Racing that will allow the Spaniard to split his time between the two, although he is committed to contesting every round of the F1 season, meaning he will miss the WEC event in Japan on October 21.
Alonso raced in last year's Indy 500 and his decision to head to Le Mans in 2018 represents the latest step in his bid to win motorsport's 'Triple Crown'.
"I've never been shy about my aim of winning motorsport's 'Triple Crown' - the Monaco Grand Prix, the Indy 500, and the 24 Hours of Le Mans. We tried for Indy last year, came close, but just missed out," he said.
"This year, I have the chance thanks to McLaren to race for the win at Le Mans. It is a big challenge - much can go wrong - but I am ready, prepared and looking forward to the fight.
"My deal to race in WEC was only made possible through the good understanding and strong relationship I have with McLaren, and I'm very happy that they listened and understood what this means to me.
"In no way will this challenge take away from my main target of Formula One with McLaren. In 2018, my aim is to be competitive at every grand prix, and I feel sure that we are closer to achieving that."
McLaren executive director Zak Brown added: "Like Fernando, at McLaren we're racers at heart, and our team is built on a brave heritage of competing and succeeding in different forms of the sport.
"Equally important is the confidence that nothing detracts from our number one goal of Formula One.
"After proper evaluation, we are satisfied that this campaign does not do that, and that McLaren's best interests prevail."
Alonso finished 38th on his Daytona 24 Hours debut on Sunday.