The 36-year-old's current deal had been due to expire at the end of the current season but after lengthy discussions with the capital club the Giallorossi legend revealed his delight at extending his stay with his hometown club on Friday.
"I have another two years of responsibilities and I'm sure we'll achieve some great things together," Totti told reporters at a press conference.
Roma are 14/1 with bet365 to win Serie A
Totti retired from international duty after winning the World Cup with Italy in 2006 but his form last season - which saw him score 12 goals in 36 Serie A appearances - prompted speculation he could return to the Azzurri fold.
And though he insists his primary focus remains improving on last season's sixth place finish with Roma, the Italian admits he would consider a recall if Cesare Prandelli comes calling.
He added: "Going to the World Cup? My jersey is the Roma jersey but obviously I remain open to the possibility. We'll see."
Club president James Pallotta was sat beside Totti at the announcement of his new deal and said his committment to the club was a sign of progress.
"I'm honoured that Francesco Totti is staying here and I'd like to toast to a great future for Roma and Francesco," said Pallotta.
"There's never been any doubt in our minds that Totti would stay. He's Roma's leader and he'll be here forever.
"I'm pleased with what we've achieved in the last few months. We're a work in progress and we're forging ahead."
Totti made his Roma debut back in 1992 and has gone on to win Serie A, the Supercoppa Italiana twice and the Coppa Italia three times in his 21 years with the club.