The deal calls for Prime Minister Mohamed Abdullahi Mohamed to resign within 30 days to pave the way for the formation of a new government that guides the country through the transitional period and prepares it for new elections.

Somalia’s squabbling leaders agreed to postpone their country’s upcoming presidential vote by one year to help the government deal with security and political issues, leaders said in an agreement released on Thursday.

The deal calls for Prime Minister Mohamed Abdullahi Mohamed to resign within 30 days to pave the way for the formation of a new government that guides the country through the transitional period and prepares it for new elections.

The international community has been putting a great deal of pressure on Somali leaders to reach an agreement before the fragile government’s term expires in August. The U.N. Security Council warned last month that the leaders risk losing financial support if they fail to end their bickering.

The deal between President Sheik Sharif Sheik Ahmed and Speaker Sharif Hassan Sheik Aden was signed in Uganda’s capital, Kampala. The U.N. envoy for Somalia, Augustine P. Mahiga said that he and Ugandan President Yoweri Museveni mediated several days of meetings between Aden and Ahmed.

“We agree to defer elections of the President and the Speaker and his deputies for twelve months after August 2011 in order to adequately prepare and complete priority transitional tasks,” the two sides said in the agreement. ”...Within thirty days of the signing of this agreement, the prime minister will resign from his position; and the president will appoint a new Prime Minister.”

Mr. Ahmed and Mr. Aden have been locked for months in a dispute over what to do when the government’s term expires. Mr. Ahmed asked for an extra year in power because he said elections were distractions as the country was in a state of war with Islamist insurgents. Mr. Aden insisted on following the country’s interim charter calling for presidential and speaker elections before August 20.

“It is a major success because the signatures have been taken. It is a major breakthrough because the parties not only agreed in a very cordial atmosphere, but there is guarantee of President Museveni. We hope this will be implemented,” Mr. Mahiga told The Associated Press by phone.

The U.N. has pushed for elections, but Uganda and Burundi - the only African countries with troops in Somalia - have objected, arguing that the government needed more time to maintain its military momentum against al—Qaeda—linked Islamists across the country.

The international community finally backed down last week, when more than 35 countries and organizations released a statement that said the extension period should not be “more than 12 months ending August 2012” unless circumstances dictate otherwise.

“This deal is perhaps a good compromise, but the question is- is it going to bring a greater stability within the government,” said Rashid Abdi, a Somali analyst with the International Crisis Group.

Government forces backed by the firepower of the African Union peacekeepers have gained ground in recent months in Somalia’s capital, Mogadishu. Pro—government forces have also succeeded in driving anti—government militants out of areas in southern Somalia near the Ethiopian and Kenyan borders.

“The parties agreed that support for the current military operations and completion of the rebuilding of the Security forces are fundamental to the success of the transitional period,” the agreement said.

Many believe that President Ahmed may have sacrificed Prime Minister Mohamed to fend off Mr. Aden’s push to oust both of them.

But Mr. Mahiga rejected that notion.

“A new cabinet means the prime minister has to resign. The emphasis should be on a new government, with a new prime minister and a new Cabinet,” Mr. Mahiga said.

In Mogadishu on Thursday, hundreds of people protested the upcoming resignation of the prime minister.

Mohamed, a Somali—American who was named prime minister in October last year, taught at a community college in western New York before he returned to Somalia. He is credited with selecting a technocrat—filled Cabinet that earned the respect of the many Somalis and the international community.

More In: News | International