Felipe Massa has accepted an offer to return to Formula 1 next year with Williams, in a deal that paves the way for Valtteri Bottas to join Mercedes.
Although final contracts have not yet been completed, Motorsport.com has learned that Massa has decided to go back on his decision to retire.
The Brazilian had announced this year that the Abu Dhabi Grand Prix would be his last F1 race.
But with Mercedes looking to sign Bottas to replace retired world champion Nico Rosberg, Massa has now agreed to stay at Williams for at least another year in order to help the team in a season where big regulations changes are set to reward experience.
Williams has signed 18-year-old rookie Lance Stroll as one of its drivers for the 2017 season, and departing tech chief Pat Symonds had said earlier this month that it was "crucial" to retain Bottas.
Massa's decision means the way is clear for Mercedes to sign Bottas, who has been tipped as the main candidate to replace Rosberg.
Mercedes has made it clear that a decision on who will partner Lewis Hamilton will not be announced before next year, with Niki Lauda saying that discussions were proving "difficult".
The world champion team admitted it had been caught off guard by Rosberg's decision and that it wanted to sort its line-up as quickly as possible.
Williams deputy team principal Claire Williams conceded the Grove squad would only let Bottas go if it could find a fitting replacement, both to mentor Stroll and for title sponsor Martini to be able to use in promotions.
"If we did allow Valtteri to leave, we would only do this if an experienced, credible alternative was available, such as someone like Felipe Massa, for example," Williams said.