Somalia PM says will quit only if parliament agrees
* Deal signed by president, speaker requires PM to resign
* Protests erupt in support of prime minister
MOGADISHU, June 11 (Reuters) - Somalia's prime minister said on Saturday he would not resign unless the country's parliament endorses an agreement signed by the country's president and speaker that stipulates he leaves office within 30 days.
The deal extended the mandate of a transitional government for a year rather than hold elections.
Somalia's latest administration was due to dissolve in August and President Sheikh Sharif Ahmed, a former Islamist rebel leader, and speaker Sharif Hassan Sheikh Aden, who covets the top job, were at loggerheads over what should happen then.
Officials at the negotiations in Ugandan capital Kampala told Reuters Prime Minister Mohamed Abdullahi Mohamed would be forced to resign under the terms of the deal to placate Aden, who accuses him of backing Ahmed.
"The Kampala decision should be presented to the parliament and then be verified by the country's constitution," Mohammed said in a statement, his first public reaction to the agreement signed on Thursday.
"The (agreement) can be valid and the PM will resign only if parliament votes for the Kampala decision."
More than 200 members of parliament planned to urge the prime minister to reconvene parliament to debate the accord, saying in a statement the deal took away parliament's oversight of the government.
Protesters said Mohamed's government had made gains against Islamist al Shabaab insurgents, who claim links to al Qaeda.
The rebels are fighting Ahmed's weak Western-backed administration, which was rocked on Friday by the killing of the country's interior minister claimed by the rebels.
Political analysts said the row between the country's two most powerful politicians had halted government activity. (Reporting by Abdi Sheikh; Writing by James Macharia; Editing by Louise Ireland)