South Africa's decision to withdraw from the International Criminal Court (ICC) has been ruled invalid and unconstitutional by the country's High Court.
Earlier in October, Burundi became the first nation to announce its intention to leave the ICC.
Last October, South Africa made a decision to withdraw from the Hague-based ICC, arguing the court's rules were "in conflict and inconsistent with" the country's diplomatic immunity law.
The president and ministers "are ordered forthwith to revoke the notice of withdrawal", he added.
The country's main opposition party, the Democratic Alliance, had protested before launching court action to challenge the government's move.
It is not clear whether the government would appeal the court's ruling.
"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".
"It's expected that the executive go back to parliament".
Gambian President Adama Barrow recently rescinded a decision by his predecessor, Yahya Jammeh, to withdraw the country from the group.
President Bashir has evaded arrest since his ICC indictment in 2009 for alleged war crimes in Sudan's Darfur conflict in which 300,000 people were killed and two million forced to flee their homes.
The decision followed several court judgments that the state violated the law by not arresting Sudanese President Omar al-Bashir‚ who has been indicted by the ICC‚ during his visit to South Africa in June 2015.
Advocates of the court retaliate that most of the African cases before the ICC were referred there by African leaders who anxious their courts could not handle the complexities of the severe kind of cases that land before the court.