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.
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.
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.
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.