Turkish police detained senior local officials from the pro-Kurdish Peoples' Democratic Party (HDP) on Friday in a raid on one of its Istanbul offices, party officials said, days after President Tayyip Erdogan said he backed legal action against its members.

Meanwhile, also on Friday, Turkey's parliament speaker said he hoped all parties, including the HDP, would take part in a parliamentary commission charged with drafting a new Turkish constitution.

Riot police and special forces took part in the police operation, according to the state-run Anadolu Agency, which said the action was part of a crackdown on urban networks of the Kurdistan Workers Party (PKK) militant group's youth wing. Local media reported that five HDP members were detained.

Erdogan and the government accuse the HDP, parliament's third-biggest party, of being an extension of the PKK, which has fought a three-decade insurgency for greater Kurdish autonomy in the southeast and which is considered a terrorist group by Turkey, the United States, and the European Union.

The HDP says it is opposed to violence and wants a peaceful solution for Turkey's Kurds.

Selahattin Demirtas, HDP co-chair, talks to VICE News.

The detentions come less than 48 hours after Erdogan said some HDP lawmakers and local mayors were behaving like members of a terrorist organization and that their positions should not shield them from prosecution. Party officials said no reason was given for the detentions.

The predominantly Kurdish southeast has sunk into its worst violence since the 1990s after a two-year ceasefire between the PKK and the state collapsed last July.

The ruling AK Party (AKP) has put replacing the country's coup-era constitution at the heart of its agenda after winning back its parliamentary majority in a November election.

Parliamentary Speaker Ismail Kahraman — whose job it is to convene a constitutional commission — said at a news conference that he was sending letters to the leaders of the HDP, AKP, the secularist Republican People's Party (CHP), and the Nationalist Movement Party (MHP).

But there is wide divergence over what the new charter should look like. Opposition parties see improving minority rights as key, and Turkey's Western partners want changes that will bring Turkey closer to European Union norms.

Erdogan is focused on introducing a new presidential system that includes stronger executive powers.

Prime Minister Ahmet Davutoglu this month held meetings with the leaders of both the CHP and the MHP, both of whom have agreed to join the commission.

A meeting with the HDP leadership was canceled amid anger between the party and the government over spiraling violence between security forces and Kurdish militants. Erdogan has even called for parliament to strip the HDP's leaders of their immunity from prosecution amid a probe into their stance on violence in the southeast.

The AKP lost its single-party majority in a June 2015 election, but after coalition talks failed, it swept back to power in a snap poll, capturing nearly 50 percent of the vote.

They still need support from 14 opposition politicians to put a new constitution to referendum or 50 votes to push it through a bitterly polarized parliament.