Casillas has hung up his gloves after a stellar career that saw him win the Champions League on three occasions with Real and the World Cup and two European Championships with Spain.
He suffered a heart attack during a training session with Porto in May last year but returned a couple of months later.
However, Casillas didn’t return to action during the course of the season and has now decided to finish his playing career.
Iker Casillas lifts the World Cup with Spain in 2010 – the legendary goalkeeper has announced his retirement from football at the age of 39
Casillas made his retirement announcement on Twitter on Tuesday as he called time on a distinguished career for Real Madrid, Porto and Spain
Casillas, 39, posted this evocative image combining Real’s Bernabeu and Porto’s Estadio do Dragao on his Twitter account
On his Twitter account on Tuesday, Casillas announced his retirement in a letter and posted an emotional message.
He said: ‘The important thing is the path you travel and the people who accompany you, not the destination to which it takes you.
‘Because that with work and effort, I think I can say, without hesitation, that is has been the path and the dream destination.’
Real Madrid also paid their own tribute to a player who appeared in 725 competitive matches for them over the course of 16 seasons between 1999 and 2015. He had been with their youth set-up since 1990.
Casillas suffered a heart attack during a training session with Porto in May last year and wasn’t able to play another professional match
The crowning glory of his career saw Spain defeat Holland to lift the World Cup in 2010
Casillas makes a low save to deny Arjen Robben during the 2010 World Cup final in Johannesburg, South Africa
They wrote: ‘Real Madrid CF wants to show his appreciation, admiration and love for one of the greatest legends of our club and world football.
‘The best goalkeeper in the history of Real Madrid and Spanish football came to our house when he was nine years old.
‘Here our shirt was formed and defended for 25 years, being forever one of our most iconic captains. Iker Casillas has earned the love of Real Madrid and is a benchmark of the values that represent Real Madrid.
‘Today, one of the most important footballers in our 118-year history, a player whom we love and admire, a goalkeeper who has enlarged the legend of Real Madrid with his work and with exemplary behavior both inside and outside, says goodbye as a professional player.
Casillas lifts the European Championship trophy in 2012 as Spain defended their title
The keeper poses with all the trophies won at Real Madrid after announcing his exit in 2015
His achievements included three Champions League titles – in 2000, 2002 and 2014