Some Somali lawmakers threw punches and wrestled on the floor after Prime Minister Ali Mohamed Gedi survived a crucial confidence vote that could have led to the collapse of his government.
Armed police entered parliament to separate four brawling members of parliament and escort Mr Gedi out during several minutes of chaos after he survived the censure motion, witnesses said.
Mr Gedi had 88 votes to his opponents' 126 - short of the two-thirds majority they needed to censure him.
Defeat would have sparked the dissolution of the interim government's executive, already in some disarray over the threat from an Islamist movement that has taken the capital, Mogadishu, and a large part of southern Somalia.
The vote took place in an old grain warehouse converted into Somalia's temporary parliament.
The anti-Gedi faction had argued his performance was incompetent and his removal necessary to create a post for Mogadishu's new Islamist rulers to come into government.
However, the Islamists' top leader said machinations within government did not affect their position of refusing talks until pro-government Ethiopian troops leave Somali soil.
"We don't care whether it's a single soldier or a whole battalion ... as long as they are in our country, we will not attend," Islamist leader Sheikh Hassan Dahir Aweys said of efforts to get both sides to a negotiating table in Sudan.
The Islamists took Mogadishu and other southern towns last month from US-backed warlords, denting the Western-backed government's aspiration to restore central rule to Somalia for the first time since the 1991 overthrow of a dictator.
Based in the provincial town of Baidoa, a former agricultural and trading town set in flat bushlands, the government was set up in 2004 to try and end anarchy in Somalia, but it has been too weak to move to Mogadishu.
Some anti-Gedi members of parliament and cabinet members are also angry at him for the government's controversial ties to Ethiopia - Somalia's traditional enemy - which is believed to have sent hundreds of soldiers over the border.
President Abdullahi Yusuf has long been close to Ethiopia, and Mr Gedi is accused by some of "selling out" to Addis Ababa too.
Today's brief brawl was not the first time Somali legislators had turned violent on the job. A 2005 parliamentary session at a Nairobi hotel also degenerated into a punch-up.
In a separate development, the first conventional passenger plane in 15 years landed at Mogadishu's recently reopened international airport today.