Torres, 35, played at Atletico Madrid, Liverpool and Chelsea in his 18-year career and is currently at Sagan Tosu in Japan’s J1 League.
In 110 games for Spain, he scored the winner in Euro 2008 and was on target in their Euro 2012 final win.
“After 18 exciting years, the time has come to put an end to my football career,” he said on social media.
Torres said he will hold a news conference in Tokyo on Sunday to “explain all the details”.
His career started with Atletico, before a £20m move to Liverpool in 2007, where he scored 81 goals in 142 games.
In 2011, he was signed by Chelsea for a then British record transfer fee of £50m.
The 35-year-old made the announcement in a tweet through his official Twitter handle.
The former Atletico Madrid star wrote: “I have something very important to announce. After 18 exciting years, the time has come to put an end to my football career.
“Next Sunday, the 23rd at 10:00 AM, local time in Japan, I will have a press conference in Tokyo to explain all the details. See you there.”
Torres, who has been most recently playing for Japanese club, Sagan Tosu, won the 2012 Champions League with Chelsea.
He also contributed greatly to Spain winning Euro 2008 and the 2010 FIFA World Cup.
Although he failed to replicate his goalscoring form at Stamford Bridge, he was part of the Blues’ Champions League-winning team in 2012.
He also won the FA Cup and scored in their 2-1 win against Benfica in the Europa League final in 2013.
After 45 goals in 172 games at Chelsea and a brief four-month loan spell at AC Milan, he returned to Atletico in late 2014.
He finished on the losing side as Atletico lost the 2016 Champions League final to Real Madrid, but won a second Europa League in 2018 – his final appearance before moving to Japan.
Torres, who is Spain’s third highest goalscorer with 38, played in six major tournaments including their 2010 World Cup triumph.