Turkey's prime minister, Recep Tayyip Erdogan, was facing the biggest challenge to his 10-year rule this weekend as parts of Istanbul turned into a war zone. Violent clashes took place between riot police and tens of thousands of demonstrators outraged at the heavy-handed response of authorities to an environmental protest on Friday.

The eruption of frustration with Erdogan's government spread to a dozen other Turkish cities overnight and supporters gathered worldwide in Boston, London, Barcelona and Amsterdam to voice solidarity with the protesters.

Police eventually withdrew from the city's central Taksim Square early on Saturday evening, bringing an end to the clashes. By late night thousands of people were celebrating there. "This is it, we won, Gezi Park is ours again", said Burcu Kurhan, 33, one protester who joined the crowds in the inner-city park where peaceful protests started on Monday. "But we hope that Tayyip will have to go!"

Several overturned police and municipal vehicles were covered in graffiti demanding the government resigns.

"This is our museum", explained one protester, laughing. "Memories of the days when a dictator ruled Turkey!"

Inside the park, the atmosphere resembled that of a summer music festival, with people scattered on the grass, singing, chatting and enjoying a beer. Celebrations united many factions of Turkish society – leftist groups, unions, nationalists, Kemalists and members of the gay and transgender communities waving rainbow flags.

"This is just the beginning, our struggle will continue!" chanted a euphoric crowd. The original protest was aimed at saving a city centre park in Istanbul from shopping centre developers who had been backed by the government. But it rapidly snowballed into a national display of anger at the perceived arrogance of the country's rulers.

While the ferocity of Friday's police crackdown attracted worldwide headlines, the mass protests against the government went largely unreported on the main Turkish TV channels and government-supporting newspapers. Erdogan, usually quick to respond to major events, also remained silent until Saturday, when he delivered a lengthy address on television. Calling for an immediate end to the protests, he pledged that the government would press ahead with the construction of the controversial shopping centre.

"Police were there yesterday, they'll be on duty today and also tomorrow because Taksim Square cannot be an area where extremists are running wild," Erdogan said. "If this is about staging a protest, about a social movement, I would … gather 200,000 where they gather 20, and where they gather 100,000, I would gather 1 million party supporters. Let's not go down that road."

Sirri Sureyya Onder, an MP from the Kurdish Peace and Democracy party (BDP), who was injured by a teargas cartridge on Saturday, said the government had gone too far in its crackdown on peaceful protesters.

"They are rebelling against all of this now. People are fed up with this lack of public discussion, with the disrespect, the immoderateness, the lawlessness and the authoritarianism of this government. It is not very good at apologising. But this time I think it will have to."

The lack of media coverage has further inflamed tension on the streets. "There is a total media blackout on this in Turkey, the Turkish media silent on the protests; they all collaborate with the government," said 21-year-old student Ayse Sarac. "We follow the foreign news coverage to get more information."

On Saturday many shop owners, hotels and residents of Istanbul's Beyoglu district showed solidarity with demonstrators, handing out water and offering shelter to those fleeing the police raids. Volunteer doctors and medical students set up makeshift clinics all over the chic central district. From a small bar just off Taksim Square, 30-year-old bar manager Esra Huri Bulduk and other activists handed out bottles of milk and anti-acidic fluids used to counter the effects of teargas.

A room in the Istanbul Chamber of Mechanical Engineers was transformed into an impromptu clinic. Up to 15 doctors have been treating victims of teargas attacks and police violence since Friday night. "We have treated more than 100 patients here," said one medical student who wished to remain anonymous. "The police now use a very heavy teargas that causes serious health problems."

Hundreds have sustained injuries over the past two days, some serious, with at least three people said to be in critical condition. There are reports of head trauma and broken limbs. Human Rights Watch confirmed that one 23-year-old student lost an eye after being hit with a plastic bullet by police.

"This excessive violence once again shows that this government is intolerant of dissent and restrictive of dissent," said Emma Sinclair-Webb, senior Turkey researcher at Human Rights Watch. "But this is a new low, even for Turkey."

The US has expressed concern over the way the Turkish government is handling the situation, and the British consulate in Istanbul took the unusual step of publicly rebuking the government for overreacting after a teargas canister landed in the consulate gardens.

"Our government actively supports the Syrian opposition, and they constantly call for more democratic rights in Syria. But look what they do to those who oppose their own ideas and policies – they try to shut us up with teargas and violence," said Nejla Gulten, a 32-year-old sociologist. "When the prime minister speaks about women, he never speaks about the problem of violence against women, but only about how many children we should have. He shapes every issue in Turkey to suit himself."