The 36-year-old had been due to retire last season but was recalled by the Williams team after Valtteri Bottas left for Mercedes following the surprise retirement of 2016 world champion Nico Rosberg.
After an emotional send-off in Brazil last year, Massa was back in the cockpit a few months later.
“As you know, last year I decided to announce my retirement in Formula One but because of the Williams request I decided to do another season,” the former Ferrari driver said in a video message posted on social media.
“But this time will be my last race in Brazil of Formula One and my last race in Abu Dhabi,” he added, thanking his family, fans and sponsors and making clear he was not retiring from racing entirely.
“I really hope that you can support me next year or maybe in the future in other races and in other categories,” he said.
The Brazilian Grand Prix, the penultimate round of the season, is next week with Abu Dhabi ending the season on Nov. 26.
Williams have yet to announce their 2018 lineup, with several candidates in the frame including Poland’s Robert Kubica. Canadian rookie teenager Lance Stroll is sure to stay, however.
Massa won 11 races with Ferrari and finished runner-up to Lewis Hamilton, now a four-times world champion, by a single point in the 2008 season.
His last victory was at the 2008 Brazilian Grand Prix, where he won new fans for his dignified and sporting response when Hamilton seized the title by taking fifth place on the last corner of the last lap.
In 2009, he suffered a severe head injury and was in a coma for several days after being hit on the helmet in Hungarian Grand Prix qualifying by a spring shed from the Brawn of compatriot Rubens Barrichello.
Massa joined Williams in 2014, helping the former champions to take third place in the constructors’ championship that year and in 2015.
“It has been an absolute pleasure to work with him,” said deputy principal Claire Williams in a team statement.
“We are especially grateful that he agreed to postpone his retirement from Formula One for a year, after Valtteri joined Mercedes, which demonstrated the depth of the relationship we built during our time together.
“We appreciate that it wasn’t an easy decision for him to return, after having such an emotional send-off at the end of last year.”