Islamist fighters have been gaining ground on the Somali government
Hardline Islamist militants have captured a strategically important town north of the Somali capital, Mogadishu, eyewitnesses say.
Members of al-Shabab, a group fighting government forces in Somalia, seized the town of Jowhar on Sunday morning.
One resident told Reuters that there had been "serious fighting" in which at least seven people had been killed.
Jowhar was in 2005 chosen as the temporary location for the country's transitional government.
The Somali government has been losing ground in recent weeks and now controls little more than the centre of the capital, with the support of African Union troops.
On 15 May, Somalia's president appealed to Islamist insurgents to negotiate as intermittent fighting continued in Mogadishu.
Jowhar is the home town of President Sheikh Sharif Sheikh Ahmed - and now that the country's rainy season has arrived, the town is also the only passable route into central Somalia from the capital.
Describing the clashes in Jowhar, town elder Ali Moalim Hassan told news agency AFP that "the other Islamist militia backing the government deserted their positions" - ceding control of the town to al-Shabab.
Al-Shabab is believed to have attacked the town on Sunday morning on two fronts. After entering the town, militants took over the jail and released prisoners.
At the same time, al-Shabab again attacked government positions in Mogadishu with mortars. The government's forces responded with their own artillery barrage.
Reports from the capital say at least three civilians died in the exchange.
The government is thought to be attempting to bring in reinforcements to retake Jowhar.
The BBC's East Africa correspondent Peter Greste says the loss of the town is a strategic blow to the increasingly unstable government led by Sheikh Ahmed.
The African Union's envoy has said that if need be, it would call on the help of allies like Nato and the European Union, who are operating warships on anti-piracy missions off the Somali coast.