* Deal paves way for three years of power sharing
* Signing was delayed amid wrangling over immunity
* Constitutional declaration still has to be signed (Adds more quotes, background)
KHARTOUM, July 17 (Reuters) - Sudan’s ruling military council and an opposition alliance signed a political accord on Wednesday as part of a power-sharing deal aimed at leading the country to democracy following three decades of autocratic rule.
The agreement, which ended days of speculation about whether a deal announced earlier this month would hold, was initialled in Khartoum in the presence of African mediators following a night of talks to iron out some details of the agreement.
Sudan’s stability is crucial for the security of a volatile region stretching from the Horn of Africa to Libya that is riven by conflict and power struggles.
The deal is meant to pave the way to a political transition after military leaders ousted former President Omar al-Bashir in April following weeks of protests against his rule.
At least 128 people were killed during a crackdown that began when security forces dispersed a protest camp outside the Defence Ministry in central Khartoum in June, according to medics linked to the opposition. The Health Ministry had put the death toll at 61.
A political standoff between Sudan’s military rulers and protesters threatened to drag the country of 40 million towards further violence before African mediators managed to bridge the gap between the two sides.
General Mohamed Hamdan Dagalo, the deputy head of Sudan’s Transitional Military Council, hailed the agreement as the start of a new partnership between the armed forces, including the paramilitary forces he leads, and the opposition coalition of Forces of Freedom and Change (FFC).
Ibrahim al-Amin, an FFC leader, said the accord signalled a new era of self-reliance for Sudan’s people.
“We want a stable homeland, because we have suffered a great deal,” Amin said in a speech after the ceremony.
Ethiopian mediator Mahmud Dirir said Sudan, long under international isolation over the policies of Bashir’s Islamist administration, needed to overcome poverty and called for the country to be taken of a U.S. list of states that support terrorism.
The sides are still working on a constitutional declaration, which is expected to be signed on Friday.
Under the power-sharing deal reached earlier this month, the two sides agreed to share power in a sovereign council during a transitional period of just over three years.
They also agreed to form an independent government of technocrats to run the country and to launch a transparent, independent investigation into the violence.
The power-sharing agreement reached earlier this month called for a sovereign council comprised of 11 members — five officers selected by the military council, five civilians chosen by the FFC and another civilian to be agreed upon by both sides.
The constitutional declaration will now decide the duties and responsibilities of the sovereign council.
The military was to head the council during the first 21 months of the transitional period while a civilian would head the council during the remaining 18 months.
But the agreement was thrown into doubt when new disputes surfaced last week over the military council’s demand for immunity for council members against prosecution.
The military council also demanded that the sovereign council would retain ultimate decision-making powers rather than the government. (Reporting by Ahmed Tolba; Writing by Sami Aboudi; Editing by Andrew Heavens and Angus MacSwan)