Machar had been expected to return to the capital on Monday, in line with a political agreement aimed at ending the two-year war, but differences over security arrangements in Juba delayed his arrival.
Ban yesterday said President Salva Kiir's government had agreed to a compromise proposal on the arrangements for Machar's return and said this breakthrough should help with the swift formation of the new unity government.
"Maintaining a spirit of cooperation will be crucial as the country's leaders begin the work of reversing the years of destruction this conflict has brought upon the people of South Sudan," he said in a statement.
Under the peace deal, Machar was to return to the post of vice president in a the new 30-month transitional government leading to elections.
More From This Section
The latest stumbling block concerned the number of machine guns and rocket-propelled grenades that rebel troops protecting Machar would be allowed to carry.
South Sudan's war began in December 2013, when Kiir accused Machar of plotting a coup.
The conflict has torn open ethnic divisions and been characterized by horrific rights abuses, including gang rapes, the wholesale burning of villages and cannibalism.
International powers, including the African Union, the European Union, China, Britain and the US, gave both Machar and Kiir a Saturday deadline to resolve differences.
Tens of thousands of people have been killed and more than two million have been driven from their homes since war broke out in December 2013.