South Sudan's two rival leaders have signed a ceasefire deal, following international pressure to avert famine and genocide.

President Salva Kiir and rebel chief Riek Machar met face-to-face on Friday in the Ethiopian capital, Addis Ababa, for the first time since mass violence broke out in December.

After a signing ceremony in the city's presidential palace, Kiir said: "Now 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."

White House National Security Advisor Susan E Rice welcomed the development. In a statement issued on Friday evening, she said that fighting in South Sudan had "robbed the country of hope and denied its people the peace and prosperity they deserve".

"We urge President Kiir and Mr. Machar to move swiftly to honor the agreement in word and deed by ending the violence and negotiating in good faith to reach a political agreement that can ensure stability, prosperity and peace for all of South Sudan’s people."

Joseph Ochieno, a London-based commentator on African affairs, told Al Jazeera: "There is just about a possibility that it [the ceasefire] will work.

"The two principles are there, Kiir and Machar, and there seems to be pressure from within the region and from the Americans. Both sides have been accused of vicious killings.

"There is a realisation that none of these guys can win on their own. They will have to give in and work together."

Speaking to Al Jazeera Toby Lanzer, the Deputy Head of the United Nations Mission in South Sudan said the ceasefire is a "good outcome."

"Right now we would love need to see an immediate truce and the cessation of violence. A concrete manifestion by both parties would be to enable the World Food Programme to load it barges in Juba and move up the Nile and other water ways up to Malakal, Bor and over to Bentiu, to deliver desperately needed assistance.

"People will be able to get out to the field and tend to their stock and crops," added Lanzer.

The United States announced sanctions this week against two men involved in the fighting in South Sudan, one loyal to Kiir and one loyal to Machar. The move appeared to be a warning to the leaders that more far-reaching sanctions were being considered.