Local residents and aid workers said the insurgents attacked the town of Hodur, 370 kilometres (235 miles) west of the Somali capital Mogadishu, around 4:30 am (0130 GMT) but then withdrew.
“The two UN mine action workers were taken from the IMC (International Medical Corps) compound. We don’t know their whereabouts and they were taken after Islamists took control of the town,” a UN official told AFP.
First reports said the two foreigners abducted were Swedes, but it later emerged that one was Danish and the other Swedish.
“According to our sources on the ground, they are a Dane and a Swede working for our organization, carrying out a demining training assignment on behalf of the United Nations,” said Aake Svensson, a spokesman for the Räddningsverket, the Swedish government’s risk assessment and emergency management agency.
A UN security official in Nairobi said: “Local authorities in the zone are negotiating with the kidnappers and calling for their immediate and unconditional release. Local chiefs are also involved in the negotiations.”
Local resident Hassan Mohamed told AFP the militants wounded a district commander during a a heavy exchange of gunfire in which a bodyguard was killed.
“They took control of the town and they also raided the IMC compound and took two foreign aid workers,” he added.
According to another local resident and a humanitarian worker the Islamists also snatched a Somali.
“The attack took place in two locations: the governor’s compound and the district commissioner’s house. Now they have left the town but they took two foreign aid workers and a Somali national,” resident Mohamed Abdullahi Yare told AFP.
“We don’t know why and where” they have taken them, said another aid worker, who asked not to be named, confirming the kidnappings. The worker said forces that attacked the town “stormed the IMC compound where the aid workers were staying.”
The latest abductions take the number of humanitarian workers kidnapped recently in this Horn of Africa country to nine: two Swedes, two Italians, one British national, one Kenyan and three Somalis.
An uninterrupted civil war has plagued Somalia since the 1991 overthrow of president Mohamed Siad Barre, defying numerous peace initiatives and truce deals.
Since their ouster early last year by joint Ethiopian and Somali forces, the Islamists have waged a guerrilla war, which according to international rights groups and aid agencies has left at least 6,000 civilians dead and displaced hundreds of thousands.
The African Union has deployed 2,600 peacekeepers in Somalia — short of the pledged 8,000 troops — but they have failed to stem violence.