"We have resigned because we have failed to fulfil the needs of the Somali people," said Abdirahman Haji Adan, state minister of parliament and government relations.
Other ministers said they had resigned because Mohamed Gedi, the prime minister, had allowed Ethiopian troops on Somalian soil.
Osman Hassan Ali Atto, minister for public works and housing, said: "The prime minister is eager to see Mogadishu attacked by forces supported by the Ethiopian government. Therefore, I do not want to a member of that cabinet."
The resignations came after a confidence motion in the government was tabled in the national assembly to protest against the presence of Ethiopian troops and the failure of Gedi to exert authority across the nation.
Somalia's largely powerless transitional government is in Baidoa, about 250km north-west of the capital Mogadishu.
An alleged weapons delivery
landed in Mogadishu this week
Mogadishu is now controlled by the Islamic Courts Group (ICG), which wrested control of the city and much of southern Somalia from US-backed militia commanders in June.
United Nations diplomats have been trying to get the transitional government and leaders of the IGC together for talks in the Sudanese capital, Khartoum.
Adan said that the ministers had resigned "to vacate all the seats for the Khartoum talks".
Talks first took place in Sudan in June, but the government boycotted a second round this month in protest at suspected violations by the ICG of a pact against military expansion.
On Wednesday the United States expressed concern about the involvement of Eritrea, and neighbour Ethiopia, in Somalia.
Ethiopia and Eritrea fought a border war from 1998 to 2000, and have since backed rebel groups to destabilise each other, leading to fears that Somalia could become a new front in the conflict.
Jendayi Frazer, the US state department's most senior Africa official, said: "There are external parties involved on all sides [and] this is a problem."