Sudan is hosting Mr Machar on "purely humanitarian grounds", it said.
Mr Machar has not been seen in public since July's clashes between his supporters and those of President Salva Kiir which killed some 300 people.
South Sudan has suffered more than two years of civil war, since gaining independence from Sudan in 2011.
The governments of both Sudan and South Sudan have accused each other of backing rebels in a bid to destabilise their countries.
Mr Machar's presence in Khartoum will give Sudan influence. It is likely to try and present itself as a mediator in the conflict, although many South Sudanese will be suspicious of its intentions.
Taban Deng Gai, Mr Machar's successor as vice-president, has also been in Khartoum this week.
He is likely to have sought assurances that Sudan is not planning on siding with Mr Machar, as well as requesting help to overcome his country's economic crisis.
Mr Machar demanded a neutral force be deployed in July to keep peace and guarantee his safety after his bodyguards and President Kiir's presidential guards fought each other, sparking days of violence.
Political differences between Mr Machar and Mr Kiir ignited the civil war in December 2013 - and they only agreed to settle their differences under intense international pressure, signing a peace deal last August.
Mr Machar returned to Juba in April to take up the post of vice-president, but President Kiir dismissed him in the wake of the latest violence.