Turkey's Prime Minister Tayyip Erdogan addresses the crowd during an opening ceremony of a new metro line in Ankara. A defiant Prime Minister Erdogan, already battling a damaging corruption scandal weeks ahead of elections, cast the latest unrest as part of a plot against the state. REUTERS/Umit Bektas

Istanbul - Turkish Prime Minister Recep Tayyip Erdogan on Thursday accused anti-government protesters of trying to stir up chaos in the country, a day after street clashes lead to the deaths of two people in the worst unrest in months.

A protester, aged 22, died in Istanbul of a head injury sustained in clashes between supporters and opponents of Erdogan's governing Justice and Development Party (AKP).

The Istanbul governor's office said shots were fired in the incident, and AKP supporters blamed the death on radical leftists.

A police officer died of a heart attack in the eastern Tunceli province, reportedly due to exposure to tear gas. At least six AKP offices were torched overnight in Istanbul, local media reported, following the largest and most volatile clashes in Turkey since mass demonstrations in Istanbul's Gezi Park last year.

Erdogan, speaking in Ankara, accused his opponents of attempting to sow “chaos” and said they “do not believe in the ballot box.” Hundreds of government supporters took part in rallies and condemned the latest deaths.

Police used tear gas, rubber bullets and water cannon to disperse protesters on Wednesday in Istanbul, where tens of thousands had gathered for the funeral of Berkin Elvan, a 15-year-old boy who has become a symbol of anti-government protests.

Elvan was in a coma after being hit in the head by a tear gas canister during protests nine months ago. His family blames the government for his death.

Clashes between riot police and activists who set up barricades, threw stones and shot off fireworks, continued late into the night. Protesters called Erdogan a “killer” and demanded his resignation.

Clashes also took place in the capital Ankara and other cities. The unrest puts Erdogan and his AKP under pressure ahead of local elections at the end of the month.

The polling is seen as a referendum on the AKP, though analysts predict the party will likely remain the most powerful political force in the country.

The election is the first since the Gezi Park unrest, which drew protesters angry with what they called Erdogan's increasingly authoritarian style of ruling.

New laws, including one politicizing the judiciary and another limiting Internet freedoms, have sparked fresh discontent among anti-government activists.