The Philippine supreme court has ousted its own chief justice, a critic of the country’s president, Rodrigo Duterte, in a vote she and hundreds of protesters called unconstitutional and a threat to democracy.

Judges voted 8-6 on Friday to remove Maria Lourdes Sereno for allegedly failing to file statements of assets and liabilities as required by law. Sereno denies the allegation and refused to participate in the vote.

Sereno has earned the ire of Duterte by speaking up for the respect of law and human rights as he has led a brutal crackdown on illegal drugs that has left thousands of suspects dead. In the nearly two years he has been in power, an opposition senator has been locked up on drug charges she says were fabricated and other critics have been insulted or threatened.

About 1,800 protesters gathered to support Sereno outside the court in Manila, where anti-riot police blocked an access road with trucks and iron railings.

Sereno is facing a separate impeachment bid in the House of Representatives, which is dominated by Duterte’s allies.

Duterte’s spokesman, Harry Roque, said the court decision must be respected. One of the justices who opposed the petition, Marvic Leonen, called it “a legal abomination” that should have been dismissed outright.

After the vote, Sereno joined her supporters outside the court. “Let’s continue to defend the constitution and fight wrongdoing. Let’s continue to spread the message of democracy and reason,” she told the crowd.

The justices who voted to remove her seized “the sole responsibility of the Senate, brazenly violated their sworn responsibility to protect the constitution and destroyed the judiciary”, the 57-year-old former law professor said.

Roman Catholic priest and protest leader Robert Reyes said outside the court: “This is more than a wake-up call. If we don’t wake up now, it will really be the death of democracy and sometimes history is cruel.”

Once an independent judge like Sereno is ousted, “there will be no more balance of power; Duterte will be a virtual dictator”, Reyes said.

Duterte has sought the removal of Sereno and a top anti-graft prosecutor, Conchita Carpio-Morales, accusing them of allowing themselves to be used to discredit his administration.

Sereno angered Duterte after she disagreed with his efforts to take action against judges linked to illegal drugs in 2016, saying the supreme court should be the one to punish erring judges.

In a speech last month, Duterte said: “So I’m putting you on notice that I am now your enemy. And you have to be out of the supreme court.”

Sereno was the first woman to head the supreme court. Her predecessor, Renato Corona, was impeached by the House in 2011.