Sudanese President Omar al-Bashir File photo: Ali Ngethi/AP

Amsterdam - Judges at the International Criminal Court (ICC) ruled on Thursday that South Africa violated ICC rules by failing to arrest Sudan president Omar al-Bashir during a 2015 visit to Johannesburg, in a case that tested international support for the court.

There is an outstanding ICC warrant for President Omar Hassan al-Bashir's arrest on genocide charges, which he denies.

Thursday's ruling has possible implications for al-Bashir and other sitting heads of state as well as for the court itself.

Judge Cuno Tarfusser, handing down judgment, said SA had an obligation to arrest al-Bashir as states party to the Rome statute have an obligation to hand over a head of state if so warranted.

The ruling was unanimous.

The ICC also addressed the question of whether it was important to refer the matter to the assembly of state parties/Security Council, saying this was a separate question and an automatic referral was not required as a matter of law in all cases of non-compliance. 

"Rather the chamber has discretion to consider all factors that may be relevant in the circumstances of the case," Tarfusser said.

Bashir, who came to power in Sudan in a 1989 Islamist and military-backed coup, was charged with genocide and crimes against humanity in 2008 over the deaths and persecution of ethnic groups in the Darfur province.

He denies the charges and continues to travel abroad, trailed by human rights activists and shunned by Western diplomats.

Though Sudan is not a member of the ICC, the court has jurisdiction there due to a 2005 UN. Security Council resolution that referred the conflict to the Hague court.

The ICC faces the risk that any action it takes will only underline waning international support for its own existence.

The United States, Russia and China never became ICC members. In Africa, resentment over the court's indictments of Africans has led Kenya to threaten withdrawal, and the African Union also called in February for mass withdrawals.

South Africa has gone further, formally notifying the United Nations last year that it intended to withdraw from the court.

Earlier this year the High Court in Pretoria court blocked the move over procedural issues, but authorities said as recently as last week that they would press ahead with the withdrawal.