Margot Wallstrom, Swedish minister for foreign affairs, said Monday she was "extremely pleased" that Gustafsson had been reunited with his family after so long.
"Johan's situation has affected many of us, and extensive efforts have been made to secure his release," Wallstrom said in a statement.
Gustafsson, 42, was kidnapped from a restaurant in Timbuktu while on vacation in Mali in 2011 along with South African Stephen McGown and Dutch national Sjaak Rijke. A fourth man, a German, was shot dead after trying to resist the kidnappers, according to the Swedish newspaper Aftonbladet
, a CNN affiliate.
The paper said Gustafsson's mother was overjoyed to hear that her son was now free, describing her reaction as "grateful and happy."
Before his release, Gustafsson's last known contact with the outside world came during a video statement released in 2015 confirming the three men were alive and well.
"I miss my family very much," Gustafsson said in the video at the time.
Wallstrom told CNN it was Sweden's "policy of principle" not to pay ransoms in kidnapping cases but wouldn't discuss the details of how the release was obtained.
"We do not want to risk making the work on other consular cases more difficult, or jeopardize the trust and confidence on which our cooperation was based," she said.
Rijke was released in April. The status of the other hostage, McGown, is not known.
In her statement, Wallstrom thanked the efforts of the Swedish Ministry for Foreign Affairs and the Swedish Police Authority's National Operations Department and other authorities in Sweden and overseas.
"This collaboration has now resulted in Johan being able to return home," she said.