Sudan's President Omar al-Bashir, who is wanted for war crimes, has left South Africa, pre-empting a court ruling over an international warrant for his arrest.
The Pretoria High Court was due to decide whether he should be handed over to the International Criminal Court, which has charged him with the crimes.
Mr Bashir was in Johannesburg for an African Union (AU) summit.
A news conference will be held in Sudan's capital upon his arrival.
A South African judge, Dunstan Mlambo, said the failure to arrest Mr Bashir had violated the country's constitution.
Mr Bashir had been barred by a court order from leaving the country until the arrest application had been considered.
The Sudanese leader is accused of committing war crimes, crimes against humanity and genocide during the Darfur conflict.
The UN says that about 300,000 people in Sudan have died since fighting began in 2003. More than 1.4 million people are thought to have fled their homes.
Government forces and allied Arab militias are accused of targeting black African civilians in the fight against rebels.
At the hearing at the Pretoria High Court, the lawyer representing the South African government said Mr Bashir's name was not on the list of passengers who took off earlier.
But the Sudanese state minister for information has told Reuters news agency that Mr Bashir's plane was expected to land in Khartoum at about 18:30 local time (1530 GMT).
It is unlikely that South Africa will face sanctions for allowing Mr Bashir to leave the country even after a
A number of African countries have in the past decided not to co-operate with the ICC. The court has been accused of racism and bias against African leaders.
So as things stand, Mr Bashir appears to have left South Africa with the blessing of the African Union, our correspondent says.
On Monday, UN Secretary-General Ban Ki-moon said the ICC's warrant for the arrest of Mr Bashir must be implemented by countries who have signed up to the court's statutes.
As a member of the ICC, South Africa is obliged to arrest anyone charged by the court.
Before the summit, the ICC issued a press statement urging the South African government "to spare no effort in ensuring the execution of the arrest warrant".
Julian Nicolls, a senior trial lawyer at the ICC, told the BBC that the court would continue to seek Mr Bashir's arrest, and warned that South Africa could be punished for defying the court's orders.
"We will evaluate what action to take next regarding South Africa's failure to arrest and transfer Mr Bashir," he said.
Kenneth Roth, the director of advocacy group Human Rights Watch, tweeted that South Africa appeared to have "shamefully flouted" the ICC and domestic court to free a man "wanted for mass murder of Africans".