ADDIS ABABA, Ethiopia — South Sudan’s warring factions on Thursday signed a new agreement to cease hostilities and protect civilians in the latest effort to calm a devastating civil war.

The two sides also signed an agreement to grant humanitarian access to conflict-affected areas after days of talks in neighboring Ethiopia brokered by the Intergovernmental Authority on Development regional bloc.

The cease-fire is set to begin Sunday morning.

South Sudan is entering the fifth year of a civil war that has killed tens of thousands of people. Parts of the East African country, the world’s youngest nation, are on the brink of famine, and well over a million people have fled abroad, creating the world’s fastest-growing refugee crisis.

Past attempts at peace deals have failed, but South Sudan’s government is under pressure to find an end to the war as the United States and others have threatened further sanctions.