The civil conflict erupted in December 2013 after Mr Kiir accused Mr Machar of plotting a coup.
Since then thousands have died and more than two million have been displaced.
South Sudan is the world’s youngest country and one of the least developed. It split from the North in 2011.
Amid a threat of sanctions from the UN, the two sides signed a peace deal in August last year.
Fighting was supposed to stop immediately but there have been frequent violations.
The men also agreed to share out ministerial positions, and a presidential decree read out on state television confirmed Mr Machar’s reappointment.
It returns the government to where it was before the war broke out.
Mr Machar, who is not currently in South Sudan, has welcomed the move, telling the BBC he could return within three weeks if security arrangements were implemented.
“I’m eager to ensure that peace returns to the country, political stability is maintained, the permanent peace is respected – I’m confident we can do this,” he said.
Pressure will now grow for the men to form a transitional government – another part of the peace agreement, says the BBC’s James Copnall, a former Sudan correspondent.
The UN and African Union have accused both sides of carrying out atrocities – last month an AU-backed report alleged that 50 civilians had suffocated after government troops locked them in a shipping container.
South Sudan: The world’s youngest country
- Split from Sudan in July 2011 after an independence referendum
- One of Africa’s least-developed economies. Highly oil-dependent
- Relations with Sudan strained by disputes over oil revenue sharing and borders
- A power struggle brought about civil war in December 2013
- An estimated 2.2 million fled their homes during conflict
- A tentative, internationally mediated, peace agreement signed in August 2015
Source: BBC Africa