DIYARBAKIR, Turkey (Reuters) - Riot police fired water cannon and tear gas to disperse protesters demonstrating in southeast Turkey on Tuesday against the ousting of three Kurdish mayors five months after they were elected.

Slideshow ( 12 images )

Ankara replaced the pro-Kurdish Peoples’ Democratic Party (HDP) mayors with state officials on Monday and detained more than 400 people for suspected militant links in a step sharply criticized by opposition parties.

In Diyarbakir, the region’s biggest city, police repeatedly used water cannon on small groups of protesters, who huddled on the streets to protect themselves from the water cannon and made victory signs with their hands.

Riot police struck protesters with batons as they fled the area. The protesters gathered near city hall, which was sealed off by metal barriers after a state administrator took office there on Monday in place of the elected mayor.

“You can see here today a regime of pressure and persecution,” HDP leader Sezai Temelli told reporters in a statement on the street in Diyarbakir as the police acted against the protesters.

“We will continue to resist wherever we are because resistance is our legitimate right,” he said.

The Interior Ministry says the ousted HDP mayors of the three major cities - Diyarbakir, Mardin and Van - are accused of various crimes including membership of a terrorist organization and spreading terrorist group propaganda.

The HDP said the mayors’ removal was a political coup and that it is a hostile stance against the political will of the Kurdish people.

The ministry also said on Monday it had launched an operation with some 2,300 commandos against Kurdistan Workers Party (PKK) militants in three southeastern provinces.

President Tayyip Erdogan had warned before nationwide local elections in March of such a move against elected officials if they were found to have had connections to the PKK.

Erdogan frequently accuses the HDP of links to the PKK, which is designated a terrorist group by Turkey, the European Union and the United States. The HDP denies such links.

The removal of the mayors echoed the dismissal of dozens of mayors in 2016 over similar accusations, part of a purge that began after a failed coup. Nearly 100 mayors and thousands of party members were jailed then in a crackdown that drew expressions of concern from the United States and European Union.

The PKK launched an insurgency against the Turkish state in 1984. More than 40,000 people have been killed in the conflict.