British teenager Lando Norris is to replace Stoffel Vandoorne at McLaren after the Belgian driver announced he is to leave at the end of the season.
Norris, 18, has been the team's reserve driver and took part in first practice sessions in Belgium and Italy in 2018.
He will partner Renault's Carlos Sainz, who will replace Vandoorne's retiring team-mate Fernando Alonso.
"This is a special moment, one I could only hope would become reality," said Norris.
"To be announced as a race driver for McLaren is a dream come true."
Norris is a title challenger in the Formula 2 feeder series this year, sitting second in the championship having won on his debut from pole position.
Since joining McLaren's Young Driver Programme in early 2017, Norris has conducted race simulation work for the team in addition to participating in testing.
"For the remainder of 2018, my focus remains firmly on the Formula 2 championship," he said.
"My objective is to win the title before joining McLaren full-time, which will be tough, but I will fight as hard as I can for the remaining four races.
"I'll also be working closely with McLaren at every opportunity to learn as much as possible from the drivers, engineers and mechanics to give myself the best preparation."
Vandoorne, 26, is 16th in the championship and has no points from his past 10 races. He finished 12th in Sunday's Italian Grand Prix.
"The past two seasons we didn't achieve the success we'd hoped, but I want to thank everyone for the opportunities they gave me," said Vandoorne.
"I intend to give it my all for the remaining seven races of this season, and will announce my plans for next season in due course."
McLaren team boss Zak Brown added: "It's clear we haven't provided Stoffel with the tools to show his true talent."
Chief F1 writer Andrew Benson
The departure of Vandoorne from McLaren at the end of this season is no surprise in one sense - he has failed to match up to team-mate Fernando Alonso since joining the team in 2017.
But it is in another - Vandoorne was one of the most successful drivers in recent years in junior categories before his graduation and was widely regarded as one of the most promising new talents around.
So, the question remains: have his difficult two seasons at McLaren proved he was not quite up to the job, or is Alonso just that good?
Alonso is an all-time great and remains at the top of his game. And Vandoorne has been much closer to the two-time champion on pace than many of the Spaniard's former team-mates, including Ferrari driver Kimi Raikkonen.
And the past two years at McLaren, with a difficult car and the end of an engine partnership with Honda and start of a new one in Renault, have not been easy. The team are in crisis - there is no other way of putting it.
It's quite possible that Vandoorne is better than a number of drivers on the grid but has just not been in a position to show it. As such, some in the paddock believe he deserves another chance.
Opportunities for 2019 are limited but they are there - at Toro Rosso and Sauber in particular.
Whether Vandoorne lands one remains to be seen.