FC Porto's goalkeeper Iker Casillas announced Monday he is retiring from soccer, a move that comes almost three months after he suffered a heart attack while training at the Portuguese club.

The former Spain and Real Madrid goalie said he would be joining the Primeira Liga side’s management.

“I am going to do something different than I usually do, which was to be on the pitch,” the 38-year-old said, according to the club’s website.

“I will try to make the connection between the team and the club. The manager talked to me last season when my situation happened and he told me that he wanted me stay with them, close to the players, near the younger players because there would be a lot of changes," he said.

“I will try to do my best to help my teammates.”

In his 16 years with Madrid, Casillas won the UEFA Champions League three times, La Liga five times, the Copa del Rey twice, the Spanish Super Cup four times and the FIFA Club World Cup twice.

He was just 19 when he hoisted the Champions League trophy for the first time in 2000, becoming the youngest goalkeeper to triumph in Europe's elite club competition.

With Porto, Casillas has won the 2017-2018 Primeira Liga crown and the 2018 Portugal Super Cup.

Casillas also leads all goalkeepers with 187 Champions League appearances and has posted the highest number of clean sheets in the tournament: 59.

Capped 167 times, Casillas was part of the Spain side that won the 2010 FIFA World Cup and the European Championship in 2008 and 2012. EFE-EPA