Thousands of people took to the streets of Istanbul overnight on Sunday, erecting barricades and starting bonfires, after riot police firing teargas and water cannon stormed a park at the centre of two weeks of anti-government unrest.

Lines of police backed by armoured vehicles sealed off Taksim Square in the centre of the city as officers raided the adjoining Gezi Park late on Saturday, where protesters had been camped in a ramshackle settlement of tents.

Prime Minister Tayyip Erdogan had warned hours earlier that security forces would clear the square, the centre of more than two weeks of fierce anti-government protests that spread to cities across the country, unless the demonstrators withdrew before a ruling party rally in Istanbul on Sunday.

"We have our Istanbul rally tomorrow. I say it clearly: Taksim Square must be evacuated, otherwise this country's security forces know how to evacuate it," he told tens of thousands of flag-waving supporters at a rally in Ankara.