South Africa had longed warned it would leave the ICC following widespread criticism for its refusal to arrest Sudan's President Omar al-Bashir, wanted by the ICC for alleged crimes including genocide committed during the Darfur conflict, which began in 2003.
South Africa has since it's hosting of the African Union Summit a year ago complained that the ICC is unfair in the way it treats African governments and is incompatible with Pretoria's peace initiatives on the continent.
The DA also argued that Justice Minister Michael Masutha unlawfully bypassed Parliament when he withdrew South Africa from the ICC and therefore did not act in line with the Constitution.
As government deliberates on a damning court finding around another unconstitutional decision, this time related to the International Criminal Court (ICC), the ruling has been welcomed by some political parties as a victory for the rule of law.
South Africa, however, remains the heavyweight in the African mutiny against the ICC.
"What is so pressing for the national executive about the withdrawal. which can not wait for our legislative processes to take their course?" the court's ruling said. Because the decision was made so quickly, and without approval from Parliament, that notice of withdrawal is unconstitutional, and must be revoked. New Gambian President Adama Barrow, who was inaugurated in January, told Newsweek that he would reverse former Gambian President Yahya Jammeh's decision.
United Nations envoy condemns market attack in Mogadishu
Troops from the African Union forced al-Shabab out of Mogadishu in 2011, but the militants remain powerful in some rural areas. The blast took place just as Somalia recently concluded a political transition process and a new President was elected.
Meanwhile, government said it will study the judgment and decide whether or not to appeal.
At a minimum, the ruling will delay South Africa's withdrawal from the ICC, which had been scheduled to take effect in October.
In 2016, Burundi, South Africa and The Gambia, expressed their intentions to withdraw from the court.
The government previously said a withdrawal bill would go to parliament, where the ruling African National Congress party has a majority and likely would approve it. It criticized the government for trying to "steamroll" over the constitution.
For many South Africans, the controversy is more about Zuma taking unilateral action without parliamentary approval than the decision to withdraw from the ICC itself, says Chloe McGrath, Africa expert at Washington-based think tank the Atlantic Council.
The process of withdrawal lasts one year and, in the case of South Africa, would take place this October.