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.

FILE PHOTO: Spain's captain Iker Casillas (C) lifts the World Cup trophy after the 2010 World Cup final soccer match between Netherlands and Spain at Soccer City stadium in Johannesburg July 11, 2010. REUTERS/Jerry Lampen/File Photo - RC1C1732E880

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.”

Football - Atletico Madrid v Real Madrid - UEFA Champions League Final - Estadio da Luz, Lisbon, Portugal - 24/5/14 Real Madrid's Iker Casillas (C) celebrates with the trophy and team mates after winning the UEFA Champions League  (Action Images / Carl Recine Livepic)

“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