Philippine President Rodrigo Duterte announced Wednesday that his country is withdrawing its ratification of the treaty that created the International Criminal Court, where he is facing a possible complaint over thousands of suspects killed in his anti-drug crackdown.

Critics expressed shock at Duterte's decision, saying he was trying to escape accountability and fearing it could foster an even worse human rights situation in the country. Others called the move a foreign policy blunder that could embolden China to scoff at Manila's victory in an international arbitration case against Beijing over contested territories.

An ICC prosecutor announced last month that she was opening a preliminary examination into possible crimes against humanity over alleged killings in Duterte's drug crackdown, angering the president..

The deaths occurring in the process of legitimate police operation lacked the intent to kill - Philippines President Rodrigo Duterte

Duterte said Wednesday that the court cannot have jurisdiction over him because the Philippine Senate's ratification in 2011 of the Rome Statute that established the court was never publicized as required by law. He called the failure to make the ratification public a "glaring and fatal error."

Thousands of mostly poor drug suspects have been killed under Duterte's drug crackdown. He argued Wednesday that the killings do not amount to crimes against humanity, genocide or similar atrocities.

"The so-called war against drugs is lawfully directed against drug lords and pushers who have for many years destroyed the present generation, specially the youth," Duterte said in a 15-page statement explaining his legal position.

"The deaths occurring in the process of legitimate police operation lacked the intent to kill," Duterte said. "The self-defence employed by the police officers when their lives became endangered by the violent resistance of the suspects is a justifying circumstance under our criminal law, hence, they do not incur criminal liability."

Philippine Drug Enforcement Agency (PDEA) agents and police secure a part of a street as they search a house during a drug raid in Maharlika Village, Taguig, south of Manila on Feb. 28. Duterte's war on drugs has left hundreds of suspects dead and sparked international inquiries. (Noel Celis/AFP/Getty Images)

Duterte also invoked presidential immunity from lawsuits, which he said prevents the ICC from investigating him while he is in office. The president renewed his verbal attacks against UN human rights officials who have expressed alarm over the massive killings.

He said the UN expert on extrajudicial killings, Agnes Callamard, had without any proof "pictured me as a ruthless violator of human rights" who was directly responsible for homicide. He also criticized ICC prosecutor Fatou Bensouda, who announced last month that she is opening a preliminary examination into the killings.

'Psychiatric evaluation' urged

Last Friday, the UN human rights chief, Zeid Ra'ad al-Hussein, suggested that Duterte "needs to submit himself to some sort of psychiatric evaluation" over his "unacceptable" remarks about some top human rights defenders.

Zeid demanded that the Human Rights Council, which counts the Philippines among its 47 member countries, "must take a strong position" on the issue, and insisted "these attacks cannot go unanswered."

Duterte has acknowledged his rough ways and tough approach to crime, but suggested many Filipinos have come to accept him.

Opposition Rep. Carlos Isagani Zarate called Duterte's move to withdraw the country from the Rome Statute a "grave setback to human rights and accountability."

It is "intended to escape accountability by present and even future officials for crimes committed against the people and humanity," Zarate said.

Another opposition lawmaker, Tom Villarin, said Duterte's action "would have unprecedented repercussions on our international standing as a sovereign state."

Villarin said it could also embolden China, which has refused to comply with an international arbitration ruling that invalidated its vast territorial claims in the South China Sea. The Philippines filed and largely won the arbitration case..