President Rodrigo Duterte of Philiphines on Wednesday announced the withdrawal of the country’s ratification of the treaty that established the International Criminal Court (ICC).

“I therefore declare and forthwith give notice, as president of the Republic of the Philippines, that the Philippines is withdrawing its ratification of the Rome Statute effective immediately,” he said in a statement.

Duterte alleged that the ICC was “being utilised as a political tool against the Philippines” after its prosecutor “prematurely” announced a preliminary examination of allegations against him relating to killings amid his campaign against illegal drugs.

In February, the ICC said it had started a preliminary examination to establish whether it had jurisdiction, and if crimes against humanity had been committed.

The complaint, which says Duterte is complicit in the illegal deaths of thousands of Filipinos during his war on drugs, was “a waste of the court’s time and resources” and the examination would be the end of the process, presidential spokesman Harry Roque said.

About 4,000 mostly urban poor Filipinos have been killed by police in the past 19 months in a brutal crackdown that has alarmed the international community.

Activists believe the death toll is far higher.

Roque said he had discussed the ICC issue for two hours the previous night with Duterte, a former prosecutor, adding that the president more than willing to face trial.

The website of the ICC, which sits in the Hague in the Netherlands, carried no new information concerning the complaint against Duterte.

The court’s office could not immediately be reached for comment.

Since it was set up in 2002, the ICC has received more than 12,000 such complaints or communications, just nine of which have gone to trial.

Duterte dared it to bring him to trial and said he would rot in jail to save Filipinos from crime and drugs.

His tirades against the court are notorious, and include calling it “bullshit”, “hypocritical” and “useless”, stemming from one of its prosecutors saying there could be grounds for an investigation into his bloody crackdown.

He also threatened to cancel the Philippines’ ICC membership and said European lawyers were “rotten”, “stupid”, and had a “brain like a pea”.

Police say those thousands of killings were during legitimate anti-drugs operations in which the suspects had violently resisted arrest.

Duterte has boasted about killing thousands of drug dealers and has told police they can kill if they believe their lives are in danger.

But his critics accuse him of incitement to murder and of refusing to properly investigate allegations that police are planting evidence, fabricating reports and executing users and dealers.

Duterte rejects such accusations and typically chides the international community for listening to what his government says are biased human rights groups that have no proof.

A Philippine lawyer filed the initial ICC complaint against Duterte and at least 11 senior officials in April 2017, saying crimes against humanity were committed “repeatedly, unchangingly and continuously” and killing drug suspects and other criminals had become “best practice”.

Senator Antonio Trillanes and Congressman Gary Alejano sent a supplementary communication several months later urging an ICC investigation, which included a list of public statements made by Duterte that they said amounted to ‘shoot-to-kill’ orders.

Trillanes said the examination “should jolt Duterte into realizing that he is not above the law”. Roque called the complainants “domestic enemies of the state” and said the ICC had no jurisdiction.