ISTANBUL — Violent protests against the government of Prime Minister Recep Tayyip Erdogan engulfed Istanbul, Turkey’s largest city, on Saturday and spread to other cities, including the capital, Ankara, as tens of thousands of demonstrators took to the streets in a second day of civil unrest and faced the tear gas and water cannons of a harsh police crackdown.

By late afternoon, the police withdrew from Istanbul’s central Taksim Square, allowing the demonstrators to gather unimpeded in the place that set off the protests last week with government plans to turn a park into a replica Ottoman-era army barracks and mall. The departure of the police, who had been widely criticized for violent tactics on Friday, set off scenes of jubilation and destruction, as some drank and partied while others destroyed police vehicles and bulldozers.

While the protest began over plans to destroy a park, for many demonstrators it had moved beyond that to become a broad rebuke to the 10-year leadership of Mr. Erdogan and his government, which they say has adopted authoritarian tactics. Some saw the police pullback as a historic victory.

“It’s the first time in Turkey’s democratic history that an unplanned, peaceful protest movement succeeded in changing the government’s approach and policy,” said Sinan Ulgen, the chairman of the Center for Economic and Foreign Policy Studies, a research group in Istanbul. “It gave for the first time a strong sense of empowerment to ordinary citizens to demonstrate and further their belief that if they act like they did the last few days they can influence events in Turkey.”