South Sudan's President Salva Kiir has appointed his rival and former rebel leader Riek Machar to be his vice president, a decree broadcast on state television said on Thursday, sealing a deal to try to end months of civil war in the world's newest nation.

The announcement returned the presidency to where it was soon before fighting erupted between supporters of the two men in December 2013 - a conflict that has killed thousands of people and forced more than two million to flee.

The decree read out on state TV said Machar would be first vice president, his position before he was sacked in 2013, the move that eventually triggered the violence.

Oil-producing South Sudan split away from Sudan in 2011 amid mass celebrations and promises of aid and sgood will from most of the developed world.

But its regional and Western backers were dismayed when fighting erupted, often along ethnic lines.

Under diplomatic pressure, including the threat of sanctions, Kiir and Machar signed a peace deal in August and agreed in January to share ministerial positions in a transitional government of national unity.

The accord has repeatedly broken down since August and analysts say there are doubts about how much control the leaders have over militias on the ground.