President Abdullahi Yusuf told parliament Monday that the prime minister will name a leaner, better qualified Cabinet to resolve differences in the government and prepare it to counter an armed Islamic fundamentalist group's bid to take over the country.

The current Cabinet will be dissolved to allow Prime Minister Ali Mohamed Gedi to nominate new members to a 31-member Cabinet, down from the 42 that has been stipulated in Somalia's transitional charter, Yusuf told parliament in a speech broadcast live on Somali radio stations. He said the new Cabinet would be nominated within seven days.

CountryWatch: Somalia

Yusuf made the announcement following Ethiopian Foreign Minister Seyoum Mesfin's weekend mediation between the leaders of Somalia's weak, U.N.-backed transitional government.

A rift within the government over how to respond to the growing influence of Islamic militants has seen 40 Cabinet and junior ministers resign since July 27.

"This agreement was suggested by the parliament speaker and I and the prime minister agreed with him to end the differences among us which could paralyze the Somali transitional government," Yusuf said in the central Somali town of Baidoa where the government and parliament are based.

As Islamic militants seized the capital and much of southern Somalia in recent months, the transitional government could only watch helplessly. The Islamists have been imposing strict religious courts, raising fears of an emerging Taliban-style regime.

Yusuf and Gedi have been unable to assert their authority beyond Baidoa, 150 miles northwest of the capital, Mogadishu.

"We don't want to just stay in Baidoa. We want to expand our government to other parts of Somalia in the coming few months," Yusuf told legislators.

"Frankly, I want to tell you one thing, the government has failed in its tasks. From now on, I hope the prime minister will appoint a new Cabinet of intellectuals, they should be experienced in running a government and Somali affairs and we should control all of Somalia in the next six months," Yusuf said. "Don't be angry if you will not be a minister because he (Gedi) will only be able to select 31 ministers."

He said that junior ministers will be nominated only for important ministries like defense, foreign affairs and interior affairs.

Yusuf and Gedi had disagreed on how to deal with the rise of Islamic courts. Yusuf has the support of parliament Speaker Sharif Hassan Sheikh Aden.

On July 30, Gedi survived a no-confidence motion because only 126 lawmakers supported it — 13 short of the number required for the motion to pass. Only 88 lawmakers voted to keep Gedi.

Last week, Yusuf said that he wanted a government delegation to go to Khartoum, Sudan on Aug. 1 for Arab League-sponsored talks with the Islamists. But Gedi said that the talks have been postponed to Aug. 17.

The ministers leaving Gedi's government have all cited his lukewarm support for Arab League-sponsored talks as their reason for resigning.

Somalia has not had an effective central government since warlords toppled longtime dictator Mohamed Siad Barre in 1991 and then turned against each other, plunging the country into anarchy.

The United States accuses the Islamists of harboring Al Qaeda leaders responsible for deadly bombings at the U.S. embassies in Kenya and Tanzania in 1998.