Turkish police clashed with protesters in Diyarbakir on Wednesday, using tear gas and water cannon to prevent them demonstrating against the detention of the Kurdish-majority city's co-mayors.

Gultan Kisanak and Firat Anli, members of the Democratic Regions party (DBP), were taken into custody on Tuesday night in a surprise move against the leaders of a city which has been hit by the renewed fighting between Turkish security forces and members of the outlawed Kurdistan Workers' Party (PKK).

The two were detained as part of a "terrorism" probe, security officials said. The Diyarbakir prosecutor said in a statement that Kisanak and Anli were accused of having links to the PKK and "inciting violence".

Hundreds of protesters tried to march to the town hall in Diyarbakir, the largest city in Kurdish-majority southeastern Turkey, some throwing rocks at police, an AFP correspondent said.

Officers responded using batons, tear gas and water cannon to repel the protesters, the correspondent said.

"The pressure will not intimidate us," demonstrators chanted.

The Diyarbakir governor's office had warned that any planned demonstrations on Wednesday were "unlawful" and would not be allowed, saying that since 15 August, public gatherings and meetings were banned in the city.

Other rallies were planned elsewhere in Turkey including Istanbul.

Idris Baluken, a member of the pro-Kurdish People's Democracy Party (HDP), called on Twitter for protests to continue against the government.

.@idrisbaluken: Sadece bir protesto gösterisi yapıp evlere dönülmeyecek. Halkımız direnişte kararlıdır. — HDP (@HDPgenelmerkezi) October 26, 2016

"They have cut the internet. They are that scared. Use whatever tactic you want. The resistance will continue uninterrupted," he said.

"It won't be just a protest and then a return home. Our public is determined to resist."

The prosecutor said Kisanak was accused of being a member of the PKK, while both individuals had made speeches in support of the rebel group.

They are also alleged to have allowed the use of municipal vehicles for the "funerals of terrorist members", the prosecutor added, referring to the PKK.

The PKK is proscribed as a terrorist organisation by Turkey as well as the European Union and US.

More than 40,000 people have been killed since it first launched an insurgency in the southeast in 1984.

A two-and-a-half-year ceasefire collapsed in July 2015 which led to almost daily attacks by the PKK against security forces while Ankara launched military operations in the southeast to rid urban areas of fighters.

Last month, 24 mayors suspected of links to the PKK were suspended and replaced with officials close to the ruling Justice and Development Party (AKP) co-founded by President Recep Tayyip Erdogan.