Porto, Portugal — Iker Casillas, the veteran FC Porto goalkeeper, had a heart attack during practice but is out of danger, the team announced Wednesday. The Portuguese club said Casillas fell ill at practice 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.

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.

Iker Casillas of FC Porto in action on May 6, 2018 in Porto, Portugal. Octavio Passos / Getty

In a statement, his former team offered its support after the incident.

Get Breaking News Delivered to Your Inbox

"Real Madrid C. F. 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," the club said in a statement.

Fellow Spaniard Rafael Nadal tweeted: "A big hug to you Iker in this moment."