McLaren has announced that a wide-ranging agreement between McLaren Racing and Fernando Alonso will see the Spaniard test for the Woking-based outfit in 2019 and 2020.
Alonso - who will run with McLaren at this year's Indy 500 - has been appointed an ambassador of McLaren Racing, a role that will involve advising the team's drivers and engineers
The two-time world champion will also lend his expertise and support to McLaren's development programme of its MCl34 and MCL35 for 2020.
"Fernando is part of the McLaren family," said McLaren boss Zak Brown.
"He has set his place in the team’s history and continues to write his chapter of the McLaren story, so it is entirely appropriate that we formalise his status as a McLaren ambassador, joining another double champion, Mika Häkkinen.
"For any race team, having someone of Fernando’s class on hand to provide support through his experience is of huge value.
"His insights and perspective will be welcomed by both our drivers and engineers alike, while his stature and character remain highly appealing to our partners and fans."
Fernando Alonso commented:
"Becoming a McLaren ambassador is a true honour. It is a special team, and despite the challenges we have endured recently, it remains so.
"I said before I stopped racing in Formula 1 last year that I see myself with McLaren for a long-time to come, so I am delighted at this new role and the ability to stay closely involved with the team I feel is my spiritual home.
"We have the Indianapolis 500 in May of course, which I am looking forward to immensely, but this is just the beginning of many things we can do together.
"I am particularly passionate about nurturing young talent, whether that’s with my own team or helping the new generation of Formula 1 drivers at McLaren unlock their true potential.
"This is important to both the team and myself, so will be an especially rewarding part of my role."