North and south Sudan have agreed to fully implement all provisions of the 2005 peace deal which ended 50 years of civil war, a US special envoy says.
The south has seen protests at the delay in implementing the peace
Both sides resolved most of the significant outstanding issues after intense negotiations, Andrew Natsios told the BBC.
Three weeks ago the south's main party pulled out of the national government in protest at non-implementation.
Mr Natsios was fearful at the time that a new civil war could begin.
But returning from a four-day visit to Sudan, Mr Natsios said the northern National Congress Party and the south's Sudan People's Liberation Movement had agreed on most outstanding issues between them.
They would, he said, be officially announcing a deal shortly.
Northern troops will be withdrawing from the south and the two sides hope to have the peace agreement fully implemented by the end of the year.
Two important issues still remain unresolved: the official demarcation of the north-south border and the control of the oil-rich region of Abyei.
Mr Natsios said he had had intensive talks with leaders on both sides, including Vice-President Ali Osman Taha and a minister in the southern regional government, Luka Piong.
"What Luka indicated to me, and Ali Osman Taha indicated, is that they have resolved most of these issues," he told the BBC World Service's Arabic Service.
"On Abyei they have agreed to some things that have moved the whole discussion along and both sides are showing flexibility.
"I don't want to say anything more than that because it's for them to announce it."