The latest round of negotiations took place over two nights beginning on Thursday, as the two sides worked out the last sticking points from a landmark agreement on power sharing that aimed to establish civilian rule in Sudan.

One of the points that had been left undecided was the fate of the Rapid Support Forces, a paramilitary run by the powerful General Hamdan. According to the agreement signed on Sunday, the forces will be directly overseen by the Sudanese Army.

Another point of contention was the possibility of absolute immunity from prosecution for military generals for past actions, including protest-related violence. The agreement established that immunity could be lifted for a convicted military official based on a vote by a legislative body made up of representatives from the pro-democracy movements, Mr. Hamid said.

Ebtesam Sanhouri, a negotiator from the protest movement, said in a news conference in Khartoum on Saturday that a transitional, military-civilian governing body would have “limited powers” and that most decisions would lie with the civilian government and the legislative body.

Al-Rayah al-Sadig, a leading member of the Sudanese Professionals Association, said in an interview that a new prime minister, chosen by the Forces for Freedom and Change, the main pro-democracy coalition, would be named immediately after the official signing ceremony for the constitutional declaration on Aug. 17.

He added that a 20-member transitional government would be named within 21 days of the ceremony. Negotiations were still underway on a proposal to postpone the dismantling of the military council until after the government is announced, he said.

The celebration on Sunday was mixed with grief, Mr. al-Sadig said, because of the memory of the dozens of protesters who had been killed since the uprising broke out and while the talks were taking place.