Francesco Totti played his final match with Roma against Genoa after a 25-season career with his hometown club. Photo: Alessandra Tarantino/AP

Francesco Totti confirmed his retirement on Monday, the Roma legend announcing he will take a directorship role at the Serie A club.

The 40-year-old played his final game for Roma in May after 24 years with the capital-city side, and decided to call it a day despite being linked with possible moves to Japan and the United States.

"The first part of my life as a football player is over and now another more important one is about to begin," Totti wrote on his Facebook page.

"Until May 28 I only thought about playing football, having fun and making a significant contribution to the team. 

"Now I move on, I'm turning over a new leaf."

Totti played 786 matches for Roma in total, scoring a club-record 307 goals, and won the 2006 World Cup with Italy.

The former attacking midfielder will work alongside new Roma sporting director Monchi and recently-appointed coach Eusebio di Francesco.

"I had 25 years and more of history with Roma," Totti added.

"The field of play has given me so much and I tried to give so much to these people, who day after day have shown me so much love.

"The beginning of a new phase, a new adventure now starts... I want to be everything and nothing, I want to be an important figure for Rome and for Roma and truly understand what I'll do."