A Swedish man kidnapped by Islamist militants in northern Mali nearly six years ago has been released from captivity, the Swedish government has confirmed.

There was no immediate word on the fate of a second hostage, from South Africa, who was also seized in Timbuktu.

The Swedish foreign minister, Margot Wallstrom, announced on Monday the release of Johan Gustafsson – who had been on a motorcycle tour through Africa – without giving details on what had finally led to his freedom, leaving also open whether the Nordic country’s government paid a ransom in exchange for his freedom.

Gustafsson, 42, was flown to Stockholm on a special Swedish government plane later Monday but he did not appear before media.

Following his arrival, Wallstrom said during a news conference that Gustafsson had been set free “a few days ago” but declined to give any details on the negotiations except to say that “diplomacy and police work” along with tight international cooperation led to his release.

“The Swedish policy is not to pay ransom in connection with kidnappings,” Wallstrom said, referring to her government’s general guideline, but refused to take questions on Gustafsson’s case.

There was no immediate word on the fate of Stephen McGown, the South African hostage. A third foreigner was freed in 2015 by French special forces.

The kidnapping of Gustafsson – who Wallstrom said was the longest-held Swedish kidnapping victim “in the modern history of Sweden” – took place in November 2011 as Islamist extremism was gaining a foothold in northern Mali.

Not long after, jihadist groups seized control of the major towns, including Timbuktu, and began enforcing their harsh interpretation of Shariah law.

The extremists were forced from their strongholds in early 2013 by a French-led military operation but continue to launch attacks on peacekeepers and Malian forces.

French hostages held in the region were released through a series of operations but Gustafsson and McGown had languished in captivity.