Williams insisted early on that it required an experienced driver to tackle the 2017 season marked by the introduction of new regulations.
It also made clear that facing the upcoming challenge with one rookie, Lance Stroll, and a still inexperienced hopeful such as Pascal Wehrlein would put the Grove-based outfit at a serious disadvantage.
The Brazilian will thus be racing for a fourth consecutive year with Williams.
“Firstly, I am very happy to have an opportunity to return to Williams," Massa says.
"I always intended to race somewhere in 2017, but Williams is a team close to my heart and I have respect for everything it is trying to achieve.
"Valtteri has a great opportunity, given the turn of events over the winter, and I wish him all the best at Mercedes.
"In turn, when I was offered the chance to help Williams with their 2017 Formula One campaign, it felt like the right thing to do.
"I certainly have not lost any of my enthusiasm for racing and I’m extremely motivated to be coming back to drive the FW40.
"The support from my fans over the last few weeks has been a huge boost and I'm grateful for that.
"I also look forward to working with Lance; I’ve known him for many years and seen his talent develop during that time, so I look forward to seeing what we can achieve together."