Following a recent resurgence in form it means the 31-year-old is to remain with the Maranello marque for an eighth consecutive year.
A short statement from Ferrari read: "Scuderia Ferrari announces it has renewed its contract with the driver Felipe Massa to the end of the 2013 race season.
"The Scuderia's driver line-up for next year is therefore made up of Fernando Alonso and the aforementioned Felipe Massa."
At one stage earlier this year it appeared as if Massa was on his way out of the team, collecting a miserable 11 points from the opening eight grands prix.
It was a point emphasised on Monday by president Luca di Montezemolo who claimed given Massa's form at the time he had little chance of being retained.
At that stage, at the end of June, Ferrari were known to be on the look out for a replacement, holding talks with Mark Webber before the Australian opted to re-sign his own new one-year deal with Red Bull.
However, since the British Grand Prix, Massa has only finished out of the points once in the subsequent eight races to claw his way up to ninth in the drivers' championship.
Watch: Massa signs new Ferrari contract... More Videos
The Brazilian's surge has also helped Ferrari overhaul McLaren into second place in the constructors' championship as the duo attempt to hunt down Red Bull over the remaining four grands prix.
In finishing second in Japan nine days ago, his first podium for 36 races - the longest top-three drought by a Ferrari driver in the team's history - and in coming fourth in Korea on Sunday, Massa firmly thrust himself back into Di Montezemolo's good books.
That prompted talks between the two men at Maranello on Tuesday, and the offer of a new deal, with Di Montezemolo claiming Massa was "back at a high level".
Di Montezemolo said: "You can see from the constructors' championship he has returned to the levels we used to know well.
"I expect a lot from him and his capacity to take points from our rivals."
It will mean another year of feverish speculation next season for Massa, in particular given speculation Sebastian Vettel is primed to join Ferrari in 2014.
That, however, was strongly denied by Di Montezemolo and Red Bull on Monday, with the former suggesting "two roosters in the same henhouse" in Alonso and Vettel would be a troublesome pairing.
Ferrari has long opted for a policy of having a number one driver, as is the case with Alonso at present, and a strong second rather than a duo both vying for the championship, but that is unlikely to stop the rumours from continuing.
In confirming their 2013 line-up, it means Ferrari join Red Bull, McLaren and Mercedes, with Lotus certain to retain Kimi Raikkonen and Romain Grosjean, leaving few seats available beyond that.
Massa, after ending months of uncertainty surrounding his future, naturally expressed himself "delighted with this agreement".
Speaking on the Ferrari website, he added: "Ferrari is my sports family.
"First, I want to thank President Montezemolo and (team principal) Stefano Domenicali, who gave me confidence which I have always maintained, even in the most difficult moments.
"Both the team and the fans can be assured I will do all that is in my power to help the Scuderia to achieve the goals that arise every year."
From his perspective, Domenicali said: "We are pleased to have extended our relationship with Felipe for another year.
"He has shown, especially in the latter part of the season, to be competitive at the highest level, as we expect from every driver behind the wheel of a Ferrari.
"We have always supported Felipe, even in the most difficult moments of his career. We are confident of its value, and that he will repay the trust that has been renewed."
Via his Twitter feed, Alonso also declared his happiness at Massa's stay, unsurprising as he knows he will again have a team-mate playing second fiddle.
Alonso said: "I am so happy to continue another year with @Felipe1Massa as a teammate! I'm sure we are the best team! £ForzaFerrari
"After 8 different teammates.. Felipe staying is another example of what I always say; Do not believe anything you read, unless it's official."