Martin Demichelis joined Malaga for a second time in January 2017. Photo by Urbanandsport/NurPhoto via Getty Images

Argentina defender Martin Demichelis announced the end of his 17-year playing career on Monday.

The former Bayern Munich and Manchester City player returned to Malaga in January after signing a six-month contract following his release by Espanyol.

The 36-year-old made his 10th league appearance for Malaga in Sunday's 2-2 draw at Real Sociedad and with a game to go before the end of the season, Demichelis made public his decision to retire.

An emotional Demichelis said in a news conference: "Unfortunately, this day comes to everyone. I had been thinking about it for some time. I always worried about the end of my career.

"I'm grateful to this profession but more so to Malaga for extending my career as a player and giving me the determination that a player needs to continue to be a professional and compete.

"I always thought that it would be a dream to end my career at Malaga and today I'm doing it.

"It's life's law, I no longer have the strength in my legs, the level of concentration needed. The day has come, the end of my career and I just have to say thank you to football."

Martin Demichelis spent three seasons at Manchester City and won three trophies with the club. Michael Steele/Getty Images

Demichelis, who started his professional career at River Plate, arrived in Europe in 2003 after signing for Bayern Munich.

He helped Bayern win four Bundesliga and four DFB Pokals before joining Malaga in December 2010, initially on loan.

Under coach Manuel Pellegrini, he made 83 appearances in his two-and-a-half seasons at the club, helping them to a fourth-place finish in his first full season and to qualification for the Champion League. He made it to the quarterfinals of the 2012-13 Champions League before leaving the club that summer for a two-month stint at Atletico Madrid.

"I want to thank Bayern Munich for counting on me for eight years, allowing me to make a name for myself," he said. "I was able to compete in the best competitions in Europe.

"My first spell at Malaga, what we achieved was great, the most glorious time of my career despite not winning any titles."

Eager to enhance his chances of playing for Argentina at the 2014 World Cup, Demichelis joined Pellegrini at Manchester City in September 2013.

He made 106 appearances for City -- winning the Premier League and two Capital One Cup winners' medals.

"I spent three years learning a lot in England and after that it was then when I considered leaving football," he said. "However, while I was in Spain on holiday, I had the opportunity to continue to play -- first at Espanyol and then at Malaga."

Demichelis won 51 caps for Argentina and was part of the squad that finished runners-up to Germany at the 2014 World Cup.