Diplomats said on Tuesday that the US State Department transferred Michael Zorick, formerly Somali political affairs officer at the US embassy in Kenya, to the Chad embassy after he spoke out.
The move exposes a rift inside the US government on how to handle Somalia, namely whether efforts to build peace should come before counter-terrorism.
At least 320 people, mostly civilians, have been killed in Mogadishu since February in battles between the local factions, including the Alliance for the Restoration of Peace and Counter-Terrorism, and Islamist militias.
A Western diplomat who is close to Zorick and asked not to be identified, told Reuters: "He really decided to take up the battle. He realised very well what he was doing."
Other diplomats involved with Somalia, including those from Washington's allies, have expressed frustration at US aid to the Alliance for the Restoration of Peace and Counter-Terrorism which they say has undermined Somalia's weak interim government, seen as the best hope for peace there.
Gunmen seize hospital
The news of Zorick's transfer came as dozens of gunmen from a US-backed alliance took over the Keysaney hospital in northern Mogadishu late on Monday.
They refused to leave despite appeals and warnings by the International Committee of the Red Cross (ICRC) that the occupation violated international law.
Backed by machine gun-mounted pick-ups, members of the Alliance for the Restoration of Peace and Counter-Terrorism entered the hospital, causing some patients to flee, and set up positions on its roof, witnesses said.
"International humanitarian law prohibits the use of a hospital for the conduct of hostilities," the ICRC said in a statement, noting that medical services had been reduced to a minimum at a time of critical need.
"The ICRC calls for the withdrawal of fighters from the hospital as soon as possible," it said.
A senior alliance commander involved in the occupation said that the fighters had deployed at the hospital to protect it from a possible attack by Islamist militia they have been battling.
"The courts planned to take the hospital and turn it into an Islamic hospital and that is what we are against," he said. "Our fighters took no patients, looted nothing and did not interfere with the hospital's business."
On Monday, the United Nations warned that interfering with humanitarian operations or denying the wounded access to medical care could be prosecuted as a war crime.
Keysaney hospital has received hundreds of casualties, many of them civilians, since the fighting pitting flared last February.
At least 62 people have been killed and hundreds wounded, most of them civilians, in the latest round of clashes that began on Wednesday, worsened on Thursday and then exploded on Saturday, when 30 died.
Analysts say Washington's links have effectively increased support for the Islamist groups.
The analysts say it has also strengthened the influential Mogadishu Sharia courts, which have brought a semblance of order to parts of the lawless country, against the interim government.
The diplomats said Zorick opposed a US intelligence plan to capture a handful of people said to be al-Qaeda suspects in Somalia, by paying local commanders, among them ministers in the government, to hunt them down.
"He felt it was wrong in the sense that it didn't achieve the objectives," the diplomat said.
Zorick was part of the peace process in Kenya to create the Somali government, formed in late 2004 in the 14th such attempt since Mohamed Siad Barre, the former president, was ousted in 1991.
The US has never confirmed its support for the militia, but has made clear it will work with anyone it considers an ally in its counter-terrorism fight.
Washington has invested considerable military and intelligence resources in the Horn of Africa, starting with a base in Djibouti, and is known to operate in tandem with local security services and Ethiopia in particular.