Fernando Alonso will race at this year's Indianapolis 500 for McLaren.
It will the two-time Formula 1 champion's third attempt at the race as he seeks to secure motorsport's 'triple crown'.
The Spaniard, 38, has won the Monaco Grand Prix and Le Mans twice and an Indy 500 win would make him only the second man in history to secure all three, after Graham Hill.
Alonso said: "I am a racer and the Indy 500 is the greatest race in the world."
He added: "I have maximum respect for the race and everyone who competes in it and all I want is to race against them and give my best."
A successful run at Indy for Alonso with McLaren this year would also act as a form of redemption after a poor debut for the company's new Indycar team at the race last year.
Alonso failed to qualify as a result of a mismanaged assault on the race by a team that lacked preparation.
McLaren have regrouped for 2020 and have joined forces with the Schmidt Peterson team to create a new outfit called Arrow McLaren SP.
They are running a two-car team in the entire Indycar series for two young, up-and-coming drivers, Mexican Patricio 'Pato' O'Ward and American Oliver Askew. Alonso's entry in the most high-profile race on the US motorsport calendar will be alongside the two regular drivers.
Gil De Ferran, McLaren's sporting director and a two-time Indycar champion who won the Indy 500 in 2001, is one of the bosses of the team.
De Ferran and Alonso became close friends when the Brazilian worked as an adviser when Alonso made his debut at Indy with a McLaren-branded car run by the Andretti team in 2017.
Then he qualified fifth, led for 24 laps and retired in the closing stages with an engine failure when looking poised to challenge for victory.
Alonso won the award for rookie of the year in 2017, and his competitive showing made McLaren's failure last year all the more galling for all involved.
Alonso had also been in talks with Andretti about racing the Indy 500 with them this year, but those fell through last month.
Alonso said: "It was important for me to explore my options for this race but Arrow McLaren SP has always been at the top. I have a special relationship with McLaren; we've been through a lot together and that creates a bond, a loyalty that is strong.
"But more than that, I am impressed with how the new organisation and operation is developing into a strong package with the Chevrolet partnership. The team has experienced, well-qualified people and great resources, and I'm confident we can be competitive."
McLaren Racing chief executive officer Zak Brown said: "We've always said we're open to running Fernando in a third car for the 500, so we're delighted he's decided to join us. Fernando is one of the greatest drivers in the sport and it's fantastic to have him as part of the team."
Brown acknowledged that Alonso had been talking to Andretti but said McLaren had been discussing Indy with him over the same period.
"Fernando is quite a thoughtful individual when he takes a decision on what he wants to race," Brown said. "This has been something that we've been speaking with Fernando about for a while. There was heavy speculation he might go elsewhere, but I think parallel conversations have been going on the entire time."