Hamsik has returned to Europe from China to sign to the end of August.
“The medical test is passed, the contract has been signed," the club wrote on their official website, announcing the arrival of the Slovakia international.
The 33-year-old will get valuable playing time ahead of the European Championship this summer.
“We had a very good dialogue since we first got in touch and he shared our vision," sporting director Pontus Farnerud said.
“Marek is here to perform, and he is very motivated. He embodies much of what IFK Goteborg want to be.
“His abilities, together with his charisma, professionalism and passion, makes him unique."