MANILA (Reuters) - The Philippines said on Wednesday it is withdrawing from the International Criminal Court (ICC) due to what President Rodrigo Duterte called “outrageous” attacks by U.N. officials and violations of due process by the ICC.

FILE PHOTO: Philippine President Rodrigo Duterte points to photographers during an awarding ceremony for outstanding government workers, at the Malacanang Palace in Manila, Philippines December 19, 2016. REUTERS/Ezra Acayan/File Photo

The decision marks a stunning about-face by Duterte, who has repeatedly dared the ICC to indict him and said he was willing to “rot in jail” or go on trial to defend a war on drugs that has killed thousands of his own people.

The mercurial former mayor had initially welcomed last month’s announcement by the ICC of its preliminary examination into a complaint filed by a Philippine lawyer accusing Duterte and top officials of crimes against humanity.

But in a 15-page statement, dated March 13, Duterte said he was withdrawing from the ICC’s founding treaty, the Rome Statute, because of “baseless, unprecedented and outrageous attacks” by U.N. officials, and ICC actions that he said failed to follow due process and presumption of innocence.

“There appears to be a concerted effort on the part of the U.N. special rapporteurs to paint me as a ruthless and heartless violator of human rights who allegedly caused thousands of extrajudicial killings,” Duterte said.

The ICC’s examination was premature, he added, and “effectively created the impression that I am to be charged ... for serious crimes falling under its jurisdiction.”

He made no mention of the withdrawal in a speech on Wednesday.

Duterte’s chief critics said the move was a U-turn that showed the tough-talking leader was now in panic mode.

“This is an embarrassing attempt to create legal cover, and a self-serving effort to avoid accountability and place himself above Philippine and international law,” said Sam Zarifi, Secretary General of the International Commission of Jurists.

The London-based rights group Amnesty International called the withdrawal “misguided” and “cowardly”.

Human Rights Watch called it “a barefaced attempt to shield him and high-ranking officials”, noting that withdrawal took a year and the ICC could still prosecute international crimes committed while the Philippines was a member.

An ICC spokesman referred most questions to the court’s prosecutors, who could not immediately be reached.

INTERNATIONAL ALARM

Duterte’s bloody campaign has caused international alarm and fierce criticism from some U.N. representatives, including High Commissioner for Human Rights Zeid Ra’ad al-Hussein, who on Friday said Duterte should submit himself for a psychiatric examination.

Duterte’s defiance is among the traits that make him wildly popular in the Philippines, where his crackdown has broad support. He has refused to accept some police may be systematically executing suspected dealers, as activists say.

Police deny allegations of murder and cover-ups and say they killed about 4,100 drug dealers in shootouts, but have nothing to do with an estimated 2,300 largely unsolved drug-related homicides.

Last month, he indicated he would cooperate with the ICC examination and even said he would prefer a firing squad to prison.

But he soon changed his tune, telling security forces not to cooperate in any international investigation, and that “not in a million years” would the ICC have jurisdiction.

Jude Sabio, the lawyer who filed the ICC complaint last year, said Duterte’s move was predictable, futile and designed to appeal to his support base.

“Looks like they are really afraid. Why? They feel that this will proceed to an investigation,” Sabio told Reuters, adding the withdrawal “will have no binding legal effect”.

The ICC can only intervene when a member state is unable or unwilling to carry out investigations and prosecute suspected perpetrators. The Philippines says that is far from the case.

The ICC’s examination seeks to establish whether crimes have taken place, and such a process typically takes years.

Duterte’s spokesman, Harry Roque, said the ICC was “siding with the enemies of the president”, while Duterte’s legal counsel Salvador Panelo said the accession to the Rome Statute in 2011 was never announced in the Philippines official gazette, thus did not apply.

Panelo insisted Duterte was not afraid, but objected to the ICC becoming “a political tool to harass a particular country, like ours”.

Duterte’s critics argued otherwise. Senator Risa Hontiveros said Duterte was desperate and “may have unwittingly displayed his fear of being proven guilty”.

Senator Antonio Trillanes said Duterte was withdrawing “because he knows that there is no way out for him in the ICC”.