South Africa’s decision to withdraw from the International Criminal Court (ICC) has been ruled “unconstitutional and invalid” by the High Court.
South Africa notified the UN of its intention to leave last October, saying the ICC pursued “regime change”.
The court ruled in favour of the opposition Democratic Alliance (DA), which argued that the government had to first seek parliamentary approval.
The court ordered the government to revoke its notice of withdrawal.
In his response, Justice Minister Michael Masutha said the government still intended to quit the ICC, Reuters news agency reports.
Africa has 34 signatories to the Rome Statute, the treaty that set up the court
The government would consider its options, including a possible appeal, after studying the full judgement, he is quoted as saying.
The decision to pull out came after a dispute over Sudanese President Omar al-Bashir’s visit to the country in 2015.
South African authorities refused to arrest Mr Bashir despite him facing an ICC arrest warrant over alleged war crimes.
Mr Bashir was attending an African Union summit in Johannesburg, when the government ignored an ICC request to arrest him.
The DA welcomed the judgement.
“The withdrawal by the South African government from the ICC was irrational and unconstitutional,” DA lawmaker James Selfe told AFP.
“We would like South Africa to stay in the ICC because we believe that it is consistent with our constitution and with the legacy of Nelson Mandela,” he added, referring to the country’s first black president.
South Africa, Burundi and Namibia are among African states that have said they will withdraw from the ICC. They accuse the court of bias against Africans.
The Gambia, which had also announced its withdrawal, has now said that it will remain in the ICC.
This follows a change of government in the West African state.