Carlos Sainz has signed a multi-year deal to replace Fernando Alonso at McLaren from the 2019 season, the team have confirmed.
Alonso, twice world champion, announced on Tuesday that he will retire from Formula 1 at the end of the year.
Fellow Spaniard Sainz, 23, is currently on loan at Renault from Red Bull and said it was a "childhood dream" to join McLaren.
"I've been a McLaren fan for as long as I can remember," he added.
"It's a great name in the sport with an incredible heritage, and the list of drivers that have raced for McLaren over the years are among the heroes of Formula 1.
"Fernando is of course one of them, so it's particularly special that I'll be taking his seat as part of the next generation of Spanish racing drivers behind the wheel of a McLaren."
|Carlos Sainz, F1 career so far|
|2015: Toro Rosso - 19 races, finished 15th in drivers' standings|
|2016: Toro Rosso - 21 races, finished 12th|
|2017: Toro Rosso/Renault - 20 races, finished ninth|
|2018: Renault - 12 races so far, currently 11th|
McLaren Racing chief executive Zak Brown said Sainz, who began his F1 career with Toro Rosso, provided "the perfect blend of youth and experience".
"We're incredibly excited to have Carlos join us as a McLaren driver," added Brown.
"We've been assessing him for some time now and rate him very highly among the next generation of young talent emerging through the ranks in Formula 1."
After the Hungarian Grand Prix, Sainz sits 11th in the drivers' championship standings with 30 points, with his best race finish fourth in Singapore while racing for Toro Rosso in 2017.
McLaren's other driver is currently Belgian Stoffel Vandoorne.