At the weekend the HDP and other pro-Kurdish groups called for self-rule in Turkey`s mainly Kurdish south-east.
Turkish prosecutors have launched an investigation into those comments.
The Turkish military has stepped up operations against the rebel Kurdistan Workers` Party (PKK), which is fighting for Kurdish self-rule. The army says it has killed more than 200 PKK militants in the latest fighting.
The PKK is regarded as a "terrorist" organisation by Turkey, the US and EU.
`Challenging the constitution`
The HDP won 59 seats in Turkey`s 550-seat parliament in the 1 November elections. It came third, behind Mr Erdogan`s Justice and Development Party (AKP) and the Republican People`s Party (CHP).
Speaking on Tuesday, Mr Erdogan said Mr Demirtas and other Kurdish leaders would be "taught a lesson" by the people and the law.
He accused Mr Demirtas of challenging Article 14 of the constitution, which bans activities deemed to "violate the indivisible integrity of the state".
On Sunday Mr Demirtas backed a declaration by a Kurdish umbrella group - the Democratic Society Congress (DTK) - which called for "autonomous regions" and "self-governance bodies".
More about: