The government and rebels in South Sudan have agreed to end fighting and form a transitional government within 60 days, Ethiopia says.
The regional Igad bloc, mediating the conflict, has threatened sanctions if they fail to abide by the agreement.
It follows a rare meeting between President Salva Kiir and rebel chief Riek Machar in Addis Ababa, Ethiopia.
Previous deals to end the violence have been broken by both sides, compounding the worsening humanitarian crisis.
Thousands have now died in the conflict that started as a political dispute between Mr Kiir and Mr Machar, his sacked deputy, but escalated into ethnic violence.
More than a million people have fled their homes since fighting erupted last December.
Ethiopian Prime Minister Hailemariam Desalegn announced the new agreement on Tuesday, after President Kiir and Mr Machar met on the sidelines of an Igad summit on Tuesday,
"If they don't abide to this agreement, Igad as an organisation will act to implement peace in South Sudan. On that, we have different options including sanctions and [other] punitive actions as well," he said.
"There has been a growing tendency to continue with the war," he added, criticising both sides for breaking a previous ceasefire agreed on 9 May.
It is the first time South Sudan's neighbours have issued such a warning, reflecting a growing frustrating with the South Sudanese leaders, correspondents say.
The US has already imposed sanctions on both sides of the conflict, singling out commanders loyal to both President Kiir and Mr Machar.
The violence began in December when Mr Kiir accused his sacked deputy of plotting a coup.
Mr Machar denied the allegation, but then marshalled a rebel army to fight the government.
The battle assumed ethnic overtones, with Mr Machar relying heavily on fighters from his Nuer ethnic group and Mr Kiir from his Dinka community.
Nearly four million people in South Sudan, which seceded from Sudan in 2011, are now at risk of serious food insecurity, according to the UN.
South Sudan is the world's newest state, becoming independent in 2011 after seceding from Sudan.