NAIROBI, Kenya - The beleaguered president of Somalia, Abdullahi Yusuf, is expected to resign, giving up a bitter struggle for control of an interim government, Western diplomats said yesterday.

Yusuf's departure, which could become official within days, would remove a major obstacle to a U.N.-backed peace process for Somalia, which has foundered amid Yusuf's clashes with his prime minister and threats by Islamist insurgents to seize the capital, Mogadishu.

Yusuf's spokesman, Hussein Mohamed Mahmoud, said the president would address lawmakers Saturday in the parliamentary seat of Baidoa.

"The president hasn't made any decision," Mahmoud said, but several Western diplomats said that Yusuf's resignation was imminent.

Yusuf, who is in his 70s, has come under growing pressure from African and Western leaders for the failure of his interim government, in place for nearly five years, to bring stability to Somalia, which has been in the grip of a bloody, clan-based civil war for nearly two decades.

A powerful Islamist-led insurgency, including fighters who U.S. officials claim are allied with al-Qaeda, now controls almost all of southern Somalia except for Baidoa and key government installations in Mogadishu.

Violence and a worsening drought have fueled a humanitarian crisis that relief agencies describe as the gravest in Africa. The U.N. estimates that 3.2 million Somalis - half the country - urgently need help.

Pirates off the northern Somali coast are taking advantage of the anarchy to terrorize international shipping.

Amid all this, Yusuf last week tried to fire his archrival, Prime Minister Nur Hassan Hussein, who has been pushing a peace deal to bring opposition groups into the government and dilute Yusuf's power.

East African regional leaders threatened Yusuf with sanctions, and some Somali lawmakers started impeachment proceedings. Yusuf appointed another prime minister anyway, although no one outside Yusuf's inner circle recognized him.

Yesterday, the new prime minister resigned, saying he did not want to be an obstacle to peace. Western diplomats who follow Somalia from neighboring Kenya, because Mogadishu is unsafe, said that Yusuf realized he had run out of options.

"He's been a spoiler for some time now," said a U.S. official, who, like others, declined to be named because of diplomatic protocol. "It's time for him to go. He understands that now."

In a country where clan relationships are paramount, Yusuf refused to reach out to rival groups, instead concentrating power in a close-knit group of security officials.

In recent months, officials in Ethiopia, whose troops had helped bring Yusuf's government to power, also had become disenchanted with him.

Many Somalis believe that Yusuf invited the Ethiopians to invade, a decision that fueled the insurgency and produced near-daily roadside bombings and mortar attacks in Mogadishu.

If Yusuf resigns, some experts see an opening for a moderate Islamist leader, Sheikh Sharif Sheik Ahmed, who led a federation of Islamic courts that briefly controlled Mogadishu in 2006, to assume a greater role in government.

U.S. and other Western officials have called Ahmed, a former schoolteacher, a possible key player in a new government.