Robert Kubica will get a reserve and development driver role with Williams for the 2018 Formula 1 season after missing out on the race seat to Sergey Sirotkin.
Kubica had been pushing for a race seat alongside Lance Stroll and tested a 2014-spec Williams twice before driving '17 machinery in Abu Dhabi.
But he lost out to 22-year-old Sirotkin and instead turned his attention to securing a supporting role.
After weeks of discussions, a deal was agreed in which Kubica will have a "particularly active role within the team this year", according to a Williams statement.
That will include Kubica taking part in Barcelona pre-season testing, in-season testing and a number of grand prix weekend practice sessions.
He will be available to stand in as a race driver if required as well as helping drive car and development performance.
The deal is regarded as a positive outcome for both Williams and Kubica.
Given Williams will have the most inexperienced line-up on the grid, Kubica will "assist the race drivers and engineers deliver better qualifying and race performance".
Kubica's appointment also helps smooth relations with title sponsor alcohol brand Martini, which requests one driver to be over the age of 25.
As part of his role, Williams says Kubica will "support the team's media and sponsorship support programme".
Kubica will get further opportunities to prove to Williams and the wider F1 paddock that he is capable of making a racing return.
"I am delighted to announce that Robert will be joining Williams as our reserve and development driver for the 2018 season," said deputy team principal Claire Williams.
"All of us at Williams have been immensely impressed at what he has achieved, and it is a great credit to his strength of character and commitment to return to Formula 1.
"We are excited to be continuing our relationship with Robert and look forward to working with him this coming season."
Autosport has produced a standalone special magazine to celebrate our 70th birthday. All current print subscribers will receive a copy for free. To order your copy of the 196-page Autosport 70th Anniversary issue, please go to: autosport.com/autosport70th