Updated

Outspoken Filipino President Rodrigo Duterte made the controversial decision to withdraw his country from the International Criminal Court amid a probe into alleged crimes against humanity in his brutal anti-drug crackdown that has killed thousands.

In a lengthy statement Wednesday, Duterte accused the ICC and the United Nations of a crusade against him, which he denounced as “baseless, unprecedented and outrageous attacks on my person.”

He said that the court cannot have jurisdiction over him because the Philippine Senate’s ratification in 2011 of the Rome Statue that established the court was never publicized as required by law.

The ICC announced last month that it was opening a preliminary examination into possible crimes against humanity over alleged extrajudicial killings in Duterte’s drug crackdown. The president’s brutal war on drugs has killed an estimated 8,000 people since he took office in May 2016.

On Wednesday, Duterte pushed back at the allegations, arguing 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, [especially] the youth,” he wrote in a 15-page statement. “The deaths occurring in the process of legitimate police operation lacked the intent to kill.”

He continued: “The self-defense 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.”

Duterte initially welcomed the changed to defend his name against ICC’s claims, but Wednesday said the court had shown a “brazen ignorance of the law.”

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

He has lashed out at European governments, saying they should "go to hell" for imposing conditions on financial aid.

On Wednesday, 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 U.N. human rights officials who have expressed alarm over the massive killings.

Last Friday, the United Nations' 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.

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.

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.

Should the UN accept Duterte’s withdrawal, it would make the Philippines only the second country to withdraw from the Rome statute, following Burundi in 2017. South Africa attempted to leave in 2016, but its withdrawal was revoked by the UN.

The Associated Press contributed to this report.