South Africa has revoked its withdrawal from the International Criminal Court (ICC) after the High Court said the move was unconstitutional.
It had notified the UN of its intention to leave last October, saying the ICC pursued "regime change".
The opposition Democratic Alliance then argued in court that the government had to first seek parliamentary approval.
But it may not be the end of the government's bid to leave The Hague-based court.
Justice Minister Michael Masutha was quoted as saying after the court ruling in February that the government would consider its options.
In the meantime, according to a statement on the UN treaties website, the planned pull out has been officially cancelled.
- Africa Live: Updates on this and more stories
- What is the International Criminal Court?
South Africa's original decision to pull out came after a dispute over Sudanese President Omar al-Bashir's visit to the country in 2015.
The authorities refused to arrest Mr Bashir despite him facing an ICC arrest warrant over alleged war crimes.Image copyright Reuters Image caption South Africa wanted to withdraw from the ICC after a row over its failure to arrest Sudan President Omar al-Bashir
Mr Bashir was attending an AU summit in Johannesburg, when the government ignored an ICC request to arrest him.
The ICC has been accused of being biased against Africans.
A non-binding African Union resolution agreed in January called for the mass withdrawal of member states from the court, with some countries accusing the ICC of undermining their sovereignty.
The ICC denies the allegation, insisting it is pursuing justice for victims of war crimes in Africa.Image copyright AFP Image caption Fatou Bensouda (R), from The Gambia, became the ICC prosecutor in 2012
Last year, Burundi and The Gambia, along with South Africa, also said they would leave the court.
But The Gambia, under new President Adama Barrow, has changed its mind.
The ICC was created by the Rome Statute to prosecute and bring to justice those responsible for the worst crimes - genocide, crimes against humanity, and war crimes.
All 23 cases that have reached at least a pre-trial phase have involved Africans.