Officials say two people have died amid clashes that erupted in Istanbul and other cities following the funeral of a teenager, who died nine months after being hit by a police tear-gas canister.

The Istanbul Governor's office said a 22-year old man died in fighting between two groups of youths late on Wednesday, as police fired water cannons and tear gas to prevent crowds from reaching Istanbul's main square after the burial of 15-year old Berkin Elvan.

In the southeastern city of Tunceli, the governor said a police officer died of a heart attack during clashes with anti-government protesters Wednesday. Officials denied reports that tear gas fired by police triggered the heart attack, insisting that the policeman had not been exposed to gas.

Anti-government protests have flared since Berkin's death Tuesday.

Prime Minister Tayyip Erdogan accused protesters on Thursday of trying to sow chaos to influence local elections after Turkey's worst day of civil unrest since anti-government demonstrations swept the nation last summer.

Late on Wednesday, a man in Istanbul was shot dead and a police officer in eastern Turkey suffered a fatal heart attack. Erdogan said demonstrators had "burned and destroyed" offices of his ruling AK Party in Istanbul.

"You were supposed to be democrats, pro-freedom. These are charlatans, they have nothing to do with democracy, they do not believe in the ballot box," Erdogan said at an opening ceremony for an underground train line in the capital Ankara.

"They are saying let's cause chaos and maybe we'll get a result. But my brothers in Ankara and Turkey will give the necessary answer on March 30 (in the local polls)," he added.

Erdogan portrays the clashes, and a corruption scandal dogging his government, as part of an anti-government plot embracing foreign and domestic forces. He accuses Islamic cleric Fethullah Gulen, a former ally, of using influence in police and judiciary to engineer the graft inquiry to undermine him.

Gulen denies such intrigues. The cleric's supporters accuse Erdogan of increasingly authoritarian conduct compromising liberal reforms of the first years of his 11 years in office.

Riot police clashed with demonstrators in several Turkish cities on Wednesday as mourners buried a teenager, wounded in the protests last June, whose death this week after nine months in a coma sparked a fresh wave of disturbances.

On Wednesday night, police fired water cannon, tear gas and rubber pellets on a major Istanbul avenue to stop tens of thousands of protesters reaching the central Taksim square.

There were similar scenes in the center of Ankara and in the Aegean coastal city of Izmir.

Officers in riot gear chased groups of protesters into side streets late into the night in Istanbul.