The South African government has a week to explain to judges why it defied a court order barring the Sudanese President Omar al-Bashir from leaving the country.
Bashir flew out of South Africa on Monday, before the end of the African Union leaders' summit, despite an earlier ruling blocking him from leaving.
A court Monday ordered the government to disclose why he was allowed to leave, in a ruling which criticised the authorities' action as inconsistent with the constitution.
Bashir, who is wanted by the International Criminal Court (ICC) for genocide and crimes against humanity in Darfur, arrived in South Africa on Saturday to attend the AU summit, prompting a court bid by a rights group to have him arrested.
The South African government said it would investigate the circumstances surrounding Bashir's departure on his presidential jet that took off from a military base.
"We will also comply with the court order relating to submission of an affidavit outlining these circumstances," the government said in a statement.
A constitutional law expert warned that South Africa's decision to defy the court order on Bashir did not bode well for the country's justice system.
"When a democratically elected government flouts the orders of a court, it undermines public confidence in the courts and undermines the legal system as a whole," said Pierre de Vos, who is based at the University of Cape Town.
De Vos said the decision "constitutes a deliberate, pre-meditated, act of contempt of court."
Bashir's presence overshadowed the summit held in Johannesburg, placing the South African government under scrutiny.
South Africa is a signatory of The Hague-based ICC and has come under global criticism for failing to arrest Bashir, who has evaded justice since his indictment in 1999.
The ICC indictments relate to the western Sudanese region of Darfur, which erupted into conflict in 2003 when black insurgents rose up against Bashir's Arab-dominated government, protesting they were marginalised.
"The decision by South Africa not to arrest al-Bashir amplifies the tension between the AU and the ICC which has been simmering for some time now," according to Netsanet Belay, Amnesty International Africa Research and Advocacy Director.
Belay said the organisation had hoped that South Africa "being a leading democracy would execute its obligation and arrest Bashir...we had high expectations."
"However we are comforted by the progressive ruling of the court."
Since his indictment, Bashir has mostly travelled to countries that have not joined the ICC and South Africa had previously stated that it would arrest him.
South Africa's neighbour, Botswana, said it was disappointed that Bashir "avoided arrest when he cut short his visit and fled, in fear of arrest, to his country".
"We have consistently indicated that should President Al-Bashir come to Botswana, we will pursue the spirit of the law as outlined in the Rome Statute," read a statement from President Ian Khama's office.
Botswana urged the AU to "lead by example" and cooperate with the ICC in "ensuring that President Al-Bashir is made to account for the atrocities committed in Darfur".
African nations have always been divided over the role of the ICC. Zimbabwe's President Robert Mugabe is one of the leaders calling for countries to withdraw from it. Zimbabwe itself is not a member.
UN chief Ban Ki-moon also joined the chorus of criticism over South Africa's failure to arrest Bashir, saying the arrest warrant was "a matter I take extremely seriously and the authority of the ICC must be respected."
South African rights group, the Southern African Litigation Centre, which led the court action, has threatened to take further legal action against the state over its handling of the case.