ISTANBUL (Reuters) - A dozen lawmakers from Turkey's opposition Peoples' Democratic Party (HDP), which has Kurdish roots, were detained on Friday because they refused to give testimony in criminal proceedings, Prime Minister Binali Yildirim said.

Democratically elected officials normally can only be forced from office in another election, but those officials who mix with and encourage "terrorism" must face legal proceedings, Yildirim told reporters in comments broadcast live.

Prosecutors began investigating more than 50 of the HDP's 59 parliamentarians after the legislature voted to scrap immunity in certain cases. HDP lawmakers decided not to testify in their cases out of protest.

(Reporting by Ayla Jean Yackley; Editing by Nick Tattersall)