In a speech to parliament on Monday, Abdullahi Yusuf said: "The bloated cabinet of prime minister Ali Mohamed Gedi's government did not do anything during its tenure.

"From today onwards, the government has been dissolved, only the prime minister will remain."

Gedi is to appoint a new 31-minister cabinet within a week after consulting parliamentary speaker Sharif Hassan Sheikh Adan and Yusuf.

The old cabinet had 42 ministers but only about half the posts were filled, since four were fired, 16 quit and one was murdered.

The move follows Ethiopian-led crisis talks that produced a deal on Sunday.

The agreement involved Somalia's top three interim leaders and aimed to end a rift hampering the government's efforts to deal with the Islamists who have taken control of much of the country.

The government had been split when Yusuf and Adan had opposed the prime minister's move to postpone proposed talks with the Islamists, who seized the capital Mogadishu and a large part of southern Somalia in June.

On Sunday, a government spokesman said the cabinet reshuffle would be based on Somalia's clan power-sharing formula, the backbone of the peace process which produced the government in Kenya in late 2004.