Jenson Button will step down from Formula 1 racing in 2017 and be replaced by Stoffel Vandoorne, but will stay with McLaren as an ambassador and reserve.
In an announcement chairman Ron Dennis insisted should not be interpreted as 'retirement', McLaren said Button would take a sabbatical next year but continue working with the team.
He has the option to return to racing in 2018 should Fernando Alonso choose to retire or leave at the end of his current deal.
Button's situation had been a key factor in the 2017 driver market, with runaway '15 GP2 champion and long-time McLaren protege Vandoorne tipped for a race seat and suggestions Button might return to his first F1 team Williams should he be replaced.
He said the deal he had reached with McLaren suited him perfectly after reflecting on his future during the August break.
"I will stay current, I will train my arse off like you've never seen before and I'll also be doing a lot of races making sure that everything is on right track and giving as much input as I can," said Button.
"I'll also be doing a lot of stuff that I haven't done for 17 years, I'll be living on my schedule, I'll get up when I want, I'll do what I want for most of the days of the year, I'll spend more time with my friends and, more importantly, my family.
"This is something that really works for me, and Im so happy that we've come to this agreement to work together over the next two years.
"I will do everything I can to make sure this team is as good as it possibly can be in 2017."
Dennis emphasised that a return to racing for Button was a real possibility.
Previous drivers who announced sabbaticals, including McLaren's 1998/99 world champion Mika Hakkinen in 2001, never returned.
"Other drivers [who took sabbaticals] never had a contract, they went away and they came back but they never had a contract like this one.
"Jenson's more than capable of winning grands prix and winning world championships, but it's not the physical, it's the mental side.
"It's not a lack of determination to win, but just the constant grind of being in F1.
"Jenson can get his mind balanced and re-established and relaxed and then look at the future.
"It's a creative contract that works for both of us, a perfect solution for the circumstances within our team at the moment."
Button has raced in F1 since 2000, when he made his debut with Williams for only his third full year of car racing after seasons in British Formula Ford and Formula 3.
A difficult spell with Benetton/Renault was followed by a breakthrough period with the team he joined as BAR but became Honda and eventually Brawn - a story that ended with a fairytale 2009 title.
He then moved to McLaren and brought his tally of grand prix wins to 15.
Button's replacement Vandoorne dominated GP2 last year and made his F1 debut in place of the injured Alonso in Bahrain this season.
"I feel pretty awesome. Jenson is a great inspiration to any racing driver," said Vandoorne, who is racing in Super Formula in Japan this year.
"He's been a very bit part of this team and I'm very happy to see him continue with us, I know his experience will be incredibly valuable to us and we're going to have a successful time together.
Alonso described the deal as "very good news for the team".
"We will have Jenson in the team which is most important," he said.
"He's the best team-mate I've ever had in terms of performance and feedback and the car development was great with him.
"Stoffel will bring fresh ideas and we will push team to maximum but still have Jenson helping us."