Image copyright EPA Image caption Rodrigo Duterte came to power in 2016 promising a crackdown on drug dealers

Philippines President Rodrigo Duterte has said he plans to withdraw his country from the International Criminal Court (ICC) after it began examining the country's drugs war.

"It is apparent that the ICC is being utilised as a political tool against the Philippines," Mr Duterte said.

He also condemned "baseless" attacks by the UN.

The ICC in February began examining alleged crimes committed during the controversial anti-drugs crackdown.

ICC chief prosecutor Fatou Bensouda said the court would be looking at reports of extrajudicial killings.

'Outrageous attacks'

Mr Duterte said he would leave the ICC "immediately", but the court says the process takes a year after an official notice of withdrawal.

A statement from the Philippine administration said the ICC inquiry was "in violation of due process".

The president also condemned "baseless, unprecedented and outrageous attacks" on him and his administration by the UN.

Media playback is unsupported on your device Media caption Mr Duterte has compared himself to Adolf Hitler in the past

"The acts allegedly committed by me are neither genocide nor war crimes. The deaths occurring in the process of legitimate police operations lacked the intent to kill."

The statement contradicts some of Mr Duterte's previous comments about the drugs war, including his willingness to "slaughter" drug addicts and dealers.

There has been growing international pressure on Mr Duterte about his country's war on drugs, which has caused the deaths of thousands.

Police claim they have killed around 4,000 drugs suspects, while rights groups suggest the figure could be far higher.

Ms Bensouda first said she was "deeply concerned" about reports of extrajudicial killings in October 2016, less than four months after Mr Duterte assumed office on a pledge to crack down on drug dealers.

And last month, as the ICC announced its preliminary inquiry, the UN Human Rights Council questioned the Philippines' human rights record and called on the country to accept a UN special rapporteur.

Harry Roque, a spokesperson for President Duterte, said in response that the ICC lacked jurisdiction over the case, calling the ICC a "court of last resort".

The court can only intervene when national authorities cannot or will not act. It has no police force of its own, and must rely on local powers to arrest and bring suspects to them.

While in theory withdrawal would not stop the court's inquiry into alleged crimes committed while the Philippines was a member, it could prove difficult to make local authorities co-operate.

There are currently 123 parties to the ICC, including the Philippines. The US has not ratified the treaty, while countries like China, India and Turkey have never signed it.

On Monday, local media reported that the Philippine Senate had filed a resolution saying the country's withdrawal from international treaties would only be valid with its consent.

The country's constitution states that adoption of an international treaty cannot be revoked without the support of both president and Senate.