Both signatories to a peace deal in South Sudan have been urged to permit shipments of food aid to reach a population in danger of mass hunger.

Toby Lanzer, the United Nations' top aid official in the region, said roads and rivers must be opened for emergency relief, adding that five million of South Sudan's citizens are in need of urgent humanitarian aid.

The UN request comes after South Sudanese president Salva Kiir and rebel commander Riek Machar signed a ceasefire deal on Friday responding to growing international pressure to end ethnic fighting that has raised fears of genocide.

The deal was made at a meeting in Ethiopia - the first time the two men had met face-to-face since violence erupted in December, following a long power struggle.

Kiir and Machar, both Christians, shook hands and prayed together. The men agreed that a transitional government offered the "best chance" to take the country towards elections next year, though there was no immediate decision on who would be part of an interim administration.

After the signing ceremony, Kiir said: "Now that we have come to our senses … dialogue is the only answer to whatever problem we had. We will continue to move in the right direction."

The truce was to take effect within 24 hours, with both sides agreeing to disengage their forces and refrain from any provocative actions, said Seyoum Mesfin, lead mediator from the regional Intergovernmental Authority on Development group.

In a statement, US Secretary of State John Kerry said: "The agreement to immediately stop the fighting in South Sudan and to negotiate a transitional government could mark a breakthrough for the future of South Sudan."

A previous ceasefire accord struck in January swiftly fell apart, with each side blaming the other for fighting that has exacerbated deep-rooted tensions between Kiir's ethnic Dink community and Machar's Nuer group.

Western powers had demanded a new deal. Kerry and UN Secretary-General Ban Ki-moon had both visited the country in the past week, part of a diplomatic push by regional and world leaders still haunted by Rwanda's 1994 genocide.

The US has already slapped sanctions on two commanders on opposing sides of the conflict, a sign of its growing frustration with the leaders of the world's youngest country, which declared independence from Sudan in 2011.