(CNN) The Philippines says it will withdraw from the International Criminal Court (ICC), a month after the judicial body started an inquiry into President Rodrigo Duterte's controversial war on drugs.

Duterte's spokesman Harry Roque said in a statement Wednesday the country had given notice that it would withdraw from the treaty that established the court.

Duterte has been accused of encouraging extrajudicial killings and other rights abuses in his bid to rid the country of drugs since his election in 2016.

The ICC announced in February it would begin a preliminary inquiry to determine whether an investigation was needed.

Roque said then Duterte would welcome the probe because "he is sick and tired of being accused ...(by) the commission of crimes against humanity."

Human rights violations

Rights groups have long accused Duterte of gross human rights violations in his anti-drug campaign, which Human Rights Watch estimates has claimed the lives of 12,000 people since June 2016. According to the Philippines government, around 3,900 people have been killed in the drug war.

Duterte has long denied the accusations of human rights abuses and contends the drug issue is one for domestic law enforcement.

He has hit out at United Nations efforts to investigate human rights violations in the country. In a speech earlier this month he ordered police not to cooperate with UN investigators and warned them "do not f*** with me."

The ICC is not part of the UN, but the two bodies have a cooperation agreement.

The bloody nature of the drugs crackdown has drawn the ire of advocates and international human rights authorities.

Last year, Amnesty International said the alleged extrajudicial killings by police "may constitute crimes against humanity."

The Philippines is not the first country to quit the ICC. Burundi, Russia, South Africa and Gambia all moved to withdraw from the court.

The ICC is meant to be a "court of last resort," a place to try dictators and other people who cannot be brought to justice domestically. It has long been controversial for its focus on the developing world, Africa in particular.

Some countries, like the United States, have never joined due to concerns about ceding sovereignty to an international body.