Government and rebels in South Sudan have signed a ceasefire agreement after talks in Ethiopia.
Under the deal, signed in a hotel in the Ethiopian capital Addis Ababa, the fighting is due to come to an end within 24 hours.
In the past week, government forces have recaptured the two main cities under rebel control.
More than 500,000 people have been forced from their homes during the month-long conflict.
“These two agreements are the ingredients to create an environment for achieving a total peace in my country,” said Taban Deng, head of the rebel delegation, AFP reports.
However, the South Sudanese government has expressed skepticism over whether the opposition will be able to control all the militias involved in fighting.
The talks have now been adjourned and are due to continue on February 7.
What started out as a political dispute between President Salva Kiir Mayardit and his former deputy Riek Machar on December 15 escalated into full-scale conflict, with reports of ethnic killings.
A ceremony to mark the signing of the agreement on the “cessation of hostilities and the question of the detainees” took place at the hotel where the talks were hosted.
The agreement is thought to address the issue of 11 detainees whom the rebels wanted freed, and whose fate had previously left the talks deadlocked.
The detainees – allies of Riek Machar and prominent political figures from a faction of the governing SPLM party – were taken into custody when Salva Kiir first made the allegations of an attempted coup – which Machar denies.
The South Sudanese government had earlier said on its Twitter feed that it envisaged an amnesty for the detainees but only after their cases had been heard in court.
Another key rebel demand was for Ugandan troops fighting alongside the government forces to be withdrawn.
Last week, the UN human rights chief said both government soldiers and rebels had committed atrocities in South Sudan, one of the world’s poorest countries.
More than 70,000 civilians are seeking shelter at UN bases across South Sudan and the UN estimates that considerably more than 1,000 have been killed.
Following the outbreak of hostilities, it was agreed to boost the UN force and an extra 5,500 peacekeepers are being deployed to South Sudan, to bring its strength up to 12,500.
[youtube mXsYkYSIIYs 650]