Somali fighters have captured a strategically important town near the capital, Mogadishu.
Witnesses said there were two hours of heavy fighting on Sunday before members of the al-Shabab group took Jowhar.
The clashes 90km north of Mogadishu come as human rights workers say at least 68 people have been killed in fighting in the capital during the past 48 hours.
Al Jazeera's Mohammed Adow, reporting from neighboring Djibouti, said: "We can confirm the town of Jowhar has been captured by al-Shabab.
"In essence, the capture of Jowhar which was one of the last strongholds of the president, means the government is quickly losing ground in the battle for Somalia and it is also virtually surrounded by al-Shabab militias who have been strengthening and consolidating their hold.
"There have been many people who had been returning to the capital and now they are being forced to go back to where they came from."
One resident told the Reuters news agency that there had been "serious fighting" in Jowhar in which at least seven people had been killed.
Al-Shabab is said to have attacked Jowhar on two fronts early in the morning and took over the prison and released detainees.
"Three civilians died and seven were injured after mortars targeting the police headquarters hit civilians," Abdulahi Mohamed Jis, a witness told AFP.
The government is thought to be attempting to bring in reinforcements to retake the area and contain the opposition fighters.
Jowhar is the home town of Sharif Ahmed, the president, and in 2005 it was 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.
PHOTO CAPTION
Opposition fighter takes aim with his weapon during clashes with Somali authorities in the vicinity of the presidential palace in Mogadishu on May 14, 2009.
Agencies