At least 10 people are believed to have been killed in a powerful explosion in the Somali capital, Mogadishu.
The dead were reported to have been anti-government militants, thought to have been killed when their bombs exploded prematurely.
The militiamen died in two separate blasts, 10 while preparing a car bomb and another as he planted a roadside bomb, it was reported.
The blasts early on Saturday were heard across the city.
Three Pakistanis, two Indians, an Afghan and an Algerian were among the dead, the Somali Information Ministry said in a statement.
The government cited "security sources" as the basis for its information.
The western-backed Somali government has been fighting the Islamist militant group al-Shabab, an al-Qaeda-inspired group that controls much of southern Somalia, since the start of 2007.
Officials say that foreign fighters with experience in the Afghanistan and Iraq conflicts help train al-Shabab's troops.
Witnesses described hearing two blasts.
Abdulahi Ibrahim, a Mogadishu resident, told Associated Press: "We heard explosions within minutes of each other.
"But in the morning when we woke up no one could figure out the details because the whole neighbourhood was cordoned off by dozens of heavily armed al-Shabab militants."
Rebel groups control much of the capital and large areas of the countryside, imposing a strict form of Sharia, or Islamic law.
Hundreds of thousands of people have fled their homes in two decades of conflict that has created one of the world's worst humanitarian emergencies.