WOKING, England — Carlos Sainz Jr. will leave Renault to drive for McLaren in Formula One next year as a replacement for Fernando Alonso.

McLaren said it signed the 23-year-old Spaniard to a "multi-year" deal without giving further details.

"I've been a McLaren fan for as long as I can remember. It's a great name in the sport with an incredible heritage," Sainz Jr. said. "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."

Alonso — a two-time F1 champion — said Tuesday he was leaving F1 at the end of the season after 32 wins, 22 pole positions and finishing F1 runner-up three times.

There is speculation that McLaren will enter IndyCar with Alonso as one of its drivers. Alonso ran the Indianapolis 500 last year and was in position to win the race until his engine failed. Alonso also ran the Rolex 24 at Daytona as a warm-up for the 24 Hours of Le Mans in June, in which Alonso was part of the winning team.

Sainz Jr. is the son of two-time world rally champion Carlos Sainz. He will likely race alongside Belgian driver Stoffel Vandoorne, although McLaren has yet to confirm its driver lineup.

McLaren chief executive officer Zak Brown has high hopes for Sainz Jr.

"We've been assessing him for some time now and rate him very highly among the next generation of young talent," Brown said.

There has been a flurry of recent activity in F1, with Australian driver Daniel Ricciardo leaving Red Bull to join Renault next year.

Ricciardo was widely expected to sign a new contract with Red Bull and his move to Renault — where he will drive alongside Nico Hulkenberg — effectively pushed Sainz Jr. out of the French team.

It also led to speculation Sainz Jr., who came through the ranks with Toro Rosso, Red Bull's feeder team, could swap in for Ricciardo.

Instead, the vacant Red Bull seat could be taken by promising French driver Pierre Gasly, who has impressed for Toro Rosso this season.

___

More AP sports: https://apnews.com/tag/FormulaOne and https://twitter.com/AP_Sports