By Joe Brock

PRETORIA (Reuters) - South Africa said on Friday it was quitting the International Criminal Court (ICC) because membership conflicted with diplomatic immunity laws, dealing a new blow to the struggling court and angering the political opposition.

Pretoria last year announced its intention to leave after the ICC criticized it for disregarding an ICC order to arrest Sudanese President Omar Hassan al-Bashir, who is accused of genocide and war crimes, when he visited South Africa. Bashir has denied the accusations.

The United Nations on Friday confirmed receipt of South Africa's withdrawal from the ICC, which will take effect one year from Oct. 19, spokesman Stephane Dujarric said, making it the first country to quit the Rome Statute.

The instrument of withdrawal document, seen by Reuters on Thursday, has been assessed by the United Nations as bona fide and is being processed, Dujarric said.

The announcement puts new pressure on the world's first permanent war crimes court, which has had to fight off allegations of pursuing a neo-colonial agenda in Africa, where all but one of its 10 investigations have been based.

Burundi's leader this week signed a decree to leave the ICC, and Kenya's parliament is considering following suit.

U.S. State Department spokesman John Kirby said the United States was "concerned" about the South African decision, but he declined to speculate what Kenya and Burundi would do and said it was too early to speak of a "trend" toward African withdrawal from the court.

Kirby said the United States, while not a member of the court, believed the ICC had made "valuable contributions in the service of accountability ...and we hope that other countries would share that assessment."

Justice Minister Michael Masutha told reporters in Pretoria that the government would draft a bill to repeal its adoption of the ICC's Rome Statute to preserve its ability to conduct active diplomatic relations, and had given formal notice.

He said the statute conflicted with South Africa's Diplomatic Immunities and Privileges Act, which was cited in the decision to ignore the court order to detain Bashir, but that the government remained committed to the fight against impunity.

The ICC said it had not formally been notified of South Africa's intention to leave the Rome Statute.

A document seen by Reuters at the United Nations on Thursday showed the move would take effect one year after notice was formally received by Secretary-General Ban Ki-moon.

The document was signed by South African International Relations Minister Maite Nkoana-Mashabane and dated Oct. 19.

"UNCONSTITUTIONAL" WITHDRAWAL

James Selfe, a senior executive at the main opposition Democratic Alliance, said it would file a court application on Friday to set aside the plans "on the grounds that it is unconstitutional, irrational and procedurally flawed".

Former South African judge Richard Goldstone, a respected figure in international justice and former chief prosecutor at the International Criminal Tribunal for the former Yugoslavia, said quitting the ICC was "demeaning" to the country.

"From a moral standpoint, it detracts from the inspiring legacy of the administration of President Nelson Mandela that so strongly supported the ICC," said Goldstone, chairman of the advisory board of the coalition for the ICC, which provides strategic guidance on key issues.

Masutha, the justice minister, said Pretoria would drop its appeal to the Constitutional Court against a ruling that the state had made an error in letting Bashir leave the country.

In June 2015 Bashir was in Johannesburg for an African Union summit. He was allowed to leave even though the ICC had ordered that he be kept in South Africa until the end of a hearing on whether he should be detained under a global arrest warrant.

The High Court ruled Bashir should have been arrested to face genocide charges at the ICC since, as a signatory of the Rome Statute, Pretoria was obliged to implement arrest warrants.

The government lost an appeal at the Supreme Court in March and the appeal to the Constitutional Court was its last chance of overturning the ruling.

The ICC, which sits in The Hague and has 124 member states, is the first legal body with permanent international jurisdiction to prosecute genocide, crimes against humanity and war crimes.

But it has secured only five substantive verdicts in its 14-year history, all of them on African suspects, and several African countries have expressed concern that the continent is being picked on.

In January, the African Union backed a proposal by Kenya's President Uhuru Kenyatta for officials of various member states to "develop a road map" on possible withdrawal from the Rome Statute. The decision was not legally binding as the final decision to leave the ICC would be taken by individual nations.

A high-profile ICC attempt to try Kenyatta and his deputy William Ruto over post-election violence failed amid diplomatic lobbying and allegations of witness intimidation.

Adan Duale, leader of the majority in the Kenyan parliament, said impetus was building there to pass a bill on quitting the ICC that has been slowly making its way through the assembly.

(Additional reporting by Michelle Nichols in New York, Toby Sterling in Amsterdam, Katharine Houreld in Nairobi and David Alexander in Washington, writing by James Macharia; editing by Mark Heinrich and Dan Grebler)