It will be the second time the Spaniard has taken part in the race, which he led in 2017 before retiring with an engine problem.

The 37-year-old, who is also competing for Toyota in the World Endurance Championship, is leaving Formula One at the end of this season and the May 26 date in Indianapolis will not clash with any commitments.

Alonso is a double Monaco Grand Prix winner and also won the Le Mans 24 Hours this year, leaving only Indianapolis between him and becoming only the second driver to achieve the ‘Triple Crown of Motorsport’.

The late Briton Graham Hill, also a two-times Formula One champion and who died in 1975, is the only one to have done it — completing the triple in 1972.

“I’ve made clear for some time my desire to achieve the Triple Crown. I had an incredible experience at Indianapolis in 2017 and I knew in my heart of hearts I had to go back if the opportunity was there,” Alonso said in a statement at the Brazilian Grand Prix.

“I’m especially glad to be returning with McLaren. This was always my first choice if the team decided to do it, so I’m delighted they’ve decided to go ahead.

“It’s a tough race and we’ll be up against the best, so it will be a huge challenge. But we’re racers and that’s why we race.”

Alonso missed the Monaco Grand Prix last year to compete at Indianapolis, no great loss for him given McLaren’s then woes with an uncompetitive Formula One car and unreliable Honda engine.

Former F1 champions McLaren are three-times Indy 500 winners — in 1972 providing a car for Mark Donohue as a private entry and in 1974 and 1976 as a works entry with Johnny Rutherford.

They will compete at The Brickyard next year as McLaren Racing.

“McLaren has a long and fond relationship with the Indianapolis 500 and it’s a case of unfinished business for us with Fernando,” said team principal Zak Brown, who had already ruled out a full IndyCar season.

“No Indy 500 is a cakewalk, it’s a massive challenge. We have the utmost respect for the race and our competitors. So, we are under no illusions. But McLaren are racers first and foremost, as is Fernando. We’re going for it.”