"It's not an easy decision (...), it was a wonderful adventure," said the 35-year-old midfielder at a press conference.
Hamsik, who has capped 136 caps for Slovakia, has represented Turkish side Trabzonspor for two seasons after a journey that included Slovan Bratislava, Brescia, Napoli, Dalian Pro and Gothenburg.
For the national team, he scored 26 goals and was in the campaigns in which Slovakia reached the round of 16 of the 2010 World Cup and Euro 2016.
For a long time, between 2007 and 2019, he was a pillar of Napoli, a club for which he played 520 games, across all competitions, winning two Italian Cups and a Super Cup.