Machar returned to government as vice-president in April 2016 after a power sharing deal, but fighting between the rival sides erupted in Juba just three months later with Machar fleeing into exile where he has remained ever since.
Kiir, who is of the Nuer minority ethnic group, accused Machar, a member of the Dinka majority, of plotting to assassinate him and occupy the first magistracy, triggering the conflagration that has cost the youngest country on the planet tens of thousands of dead and wounded and the forced displacement of millions of people.
Sudan's President Omar al-Bashir attended the signing ceremony in Sudan's capital, Khartoum.
"In initials, an agreement on outstanding issues has been signed and this agreement expresses the commitment of all parties to a ceasefire", Foreign Minister Al Dirdiri Mohamed said on Sudan state television.
South Sudan became independent from Sudan in 2011, but civil war broke out two years later between the government led by Kiir and a rebel movement led by former vice president Riek Machar.
The deal stipulates that there will be 35 ministers in the transitional government - 20 from Kiir's group and nine from Machar's, while the rest will represent other groups.
Radio telescope picks up new frequency in space ZlotoNews
As a result, scientists believe that the source (whatever it is - PRESUMABLY ALIENS, THOUGH) is likely to be extremely powerful. If you haven't heard of fast radio bursts (FRBs), they're some of the most explosive and mysterious events in the Universe.
But Sudan's Bashir said the mediators were committed to ensure that the agreement was implemented.
The parliament will be comprised of 550 lawmakers, including 332 from Kiir's group and 128 from Machar's faction.
The Khartoum peace talks are seen as the last chance at bringing peace to South Sudan.
"I would urge. IGAD to focus after this on the implementation of the agreement", Machar said in his address.
Sudan helped broker the agreement.
On Friday, Kiir pledged the deal would "not collapse" because it, unlike the previous peace initiatives, had not been imposed by outside powers.