Spanish goalie Iker Casillas is recovering after suffering a heart attack Wednesday during a morning soccer training session, Porto FC announced.

The 37-year-old player, who has been paying in Portugal since leaving Spanish giants Real Madrid in 2015, suffered an acute myocardial infarction, the team said in a statement.

He was taken to Hospital CUF Porto where he underwent surgery. The team said Casillas is “well, stable and his heart problem solved.”

Casillas left Real Madrid in 2015 after an illustrious career in the Spanish capital, winning 19 trophies including five La Liga titles, three Champions League trophies and two Copa del Rey crowns.

He holds the record for most appearances by a goalie in the FIFPro World XI as well as the record for most ever appearances in the Champions League.

With the Spanish national team, Casillas won three major trophies in a row, capturing the 2008 and 2012 European Championships and the 2010 World Cup.

TENNIS STAR SLOANE STEPHENS, US SOCCER’S JOZY ALTIDORE ANNOUNCE ENGAGEMENT

His former club led the tributes to the soccer star, saying in a statement that Casillas “taught us throughout his professional career to overcome the most incredible challenges to enhance the glory of our club.”

“He has taught us that surrendering does not fit into our philosophy of life and has shown us countless times that being strong no matter how hard the challenge is the path to victory,” the statement said. “Real Madrid wants to see their eternal captain recovered as soon as possible and send him all the courage of the world.”

Some of his former teammates and rivals quickly shared their get-well-soon messages.

Casillas, whose contract with the Portuguese giants was recently extended until the end of the 2019-20 season, is not expected to play again for the club this season.

CLICK HERE TO GET THE FOX NEWS APP