The Portuguese club said Casillas fell ill during a practice session and remains hospitalized, but the "heart condition has been resolved."
It said the 37-year-old Spaniard is "doing well" and is in stable condition.
Porto said the practice session at the team's training center was interrupted so doctors could attend to Casillas.
No timeline was given for how long the goalkeeper will be sidelined. Defending champion Porto trails Benfica by two points in the Portuguese league with two games left.
Messages of support poured in from clubs and players across the world.
"Real Madrid wishes to offer its full support to our beloved captain Iker Casillas," the Spanish club said in a statement. "Iker Casillas has shown us how to overcome the most incredible challenges throughout his professional career, adding significantly to our club's successes. He's shown us that giving up has no place in our way of life and demonstrated time and again that staying strong during the hardest of challenges is the only path to victory.
"Real Madrid and all of madridismo look forward to seeing our legendary captain back in good health as soon as possible and we send him all the encouragement in the world."
Casillas joined Porto in 2015 after 16 seasons with Real Madrid, which he helped win five Spanish league titles and three Champions League trophies.
Casillas also helped Spain's national team win one World Cup and two European Championships.
The goalkeeper's contract with Porto was recently extended until the end of the 2019-20 season, with an option for another one-year extension.
Please click to read our informative text prepared pursuant to the Law on the Protection of Personal Data No. 6698 and to get information about the cookies used on our website in accordance with the relevant legislation.
6698 sayılı Kişisel Verilerin Korunması Kanunu uyarınca hazırlanmış aydınlatma metnimizi okumak ve sitemizde ilgili mevzuata uygun olarak kullanılan çerezlerle ilgili bilgi almak için lütfen tıklayınız.