South Sudan's warring parties signed a peace deal on Sunday in the latest attempt to end the country's five-year civil war, which has killed tens of thousands and displaced millions.

President Salva Kiir and former Vice-President and rebel opposition leader, Riek Machar signed the agreement, said Sudan's state news agency, SUNA.

As part of the deal, Kiir will remain president and Machar will return to the country as the First Vice President, one of five vice presidents. There will be an eight-month pre-transitional period led by Kiir, followed by a three-year transitional period. The government will include 20 ministers from Kiir's party, nine from Machar's and six from other groups, said the agreement.

This is the latest of several attempts at peace agreements and cease-fires since war broke out in 2013. The first peace agreement fell apart in July 2016 when fighting erupted in the capital Juba and Machar fled the country on foot. He's since been under house arrest in South Africa.

South Sudan's government insists this time things will be different between the two leaders and Machar has "learned the hard way" and has promised to work with Kiir because he doesn't want to go back to South Africa, said government spokesman, Michael Makuei, at a press conference in Juba last week. Upon his return, Machar's troops are to go to cantonment sites for training to be unified with the government army, he said.

At least one South Sudan expert is calling the deal "a high-risk model" for trying to end the conflict.

"In 2013, Riek competed to replace Kiir and Kiir violently expelled him. In 2016, Riek competed to replace Kiir and Kiir violently expelled him. Both events led to large-scale atrocities. This peace deal sets up the exact same scenario for the third time," said Alan Boswell a South Sudan conflict analyst. "When it fails, it fails explosively."

Multiple cease-fires have been signed in recent years, all of which have been violated within hours of being implemented. The international community's patience has been waning with the young nation and last month the U.N. Security Council imposed an arms embargo.

In July South Sudan's parliament extended the government's mandate until 2021, angering the opposition, which said the government was "playing games" at the negotiating table.

Some rights groups applaud the deal, but cautioning that it's only a first step.

"To prevent a return to war, the agreement must ensure that overwhelming power is not concentrated in a few hands," said Brian Adeba, deputy director of policy at the Enough Project, a Washington-based advocacy group.

Edmund Yakani, executive director of Community Empowerment for Progress Organization, a local rights group called the deal a positive development, but said he's not fully convinced.

"The challenge is the will the political leaders and we are expecting them to take primary responsibility for making peace happen in South Sudan," he said.