ANKARA, Turkey (AP) -- Turkey's president on Monday defended the right of citizens to protest, in strong contrast to the dismissive stance of the prime minister, as police used tear gas for a fourth day in an attempt to disperse demonstrations that grew out of a sit-in to prevent the uprooting of trees at Istanbul's main square.
Turkey has been hit by demonstrations since Friday sparked by anger over excessive police force against protesters holding a sit-in against redevelopment of Istanbul's main Taksim Square.
The demonstrations spiraled into Turkey's biggest anti-government disturbances in years, challenging Prime Minister Recep Tayyip Erdogan's power. The protests were seen as a display of frustration against Erdogan, who has appeared to be increasingly authoritarian and is accused of meddling in all aspects of life.
Erdogan, who has been in power since 2003 having won three landslide elections, inflamed tensions by calling protesters "a bunch of looters" and by branding them a "minority" trying to force demands on his majority.
On Monday, Erdogan again dismissed the street protests as being organized by extremists, described them as a temporary blip and angrily rejected comparisons with the Arab Spring uprisings.
Appearing defensive and angry, he lashed out at reporters who asked whether the government had understood "the message" by protesters or whether he would soften his tone.
"What is the message? I want to hear it from you," Erdogan retorted.
"What can a softened tone be like? Can you tell me?" he said. He spoke to reporters before leaving on what was planned to be a four-day trip to Morocco, Algeria and Tunisia.
The demonstrators, mostly secular-minded Turks, took to the street airing frustrations at Erdogan's abrasive and non-compromising style as well as the heavy-handed police response to protests. Some of the protesters clashed with police, but most of the protesters demonstrated peacefully, chanting calls for Erdogan to resign. Those who did not take to the streets banged on pots and pans from windows and balconies.
"When we speak of democracy, of course the will of the people is above all," Gul said. "But democracy does not mean elections alone."
"There can be nothing more natural for the expression of various views, various situations and objections through a variety of ways, besides elections," he said.
He added: "The views that are well intentioned have been read, seen and noted and the messages have been received."
There was scattered violence in areas close to Erdogan's offices in Istanbul and in Ankara. The Dogan news agency said police fired tear gas at the group in an area close to Erdogan's Istanbul office. The protesters responded by hurling stones.
The agency said as many as 500 people were detained overnight Monday after police clashed with more militant protesters and then moved in to break up several thousands of people demonstrating peacefully. Turkey's Fox television reported 300 others detained in a similar crackdown in Izmir, Turkey's third-largest city.
Social media were awash with reports and videos of police abuse. Authorities have said police excesses would be investigated, but they appeared to continue unabated.
Fox showed footage of police telling a group sheltering by the side of a building to come out, reassuring that nothing would happen, then shooting a gas canister at one of them.
A group of protesters took control of a large earth digger near the area and drove it toward police water cannon, Dogan news agency footage showed. Medics were seen tending to people injured in the skirmishes or affected by gas at a mosque close to the palace.
Erdogan described some of the protesters as "naive, decent and participating (in demonstrations) by following information on social media" but claimed the protests were being organized by Turkey's opposition party and extremist groups.
He also blamed the protest on "internal and external" groups bent on harming Turkey, said the country's intelligence service was working on identifying them and threatened to hit back at them.
"We shall be discussing these with them and will be following up, in fact we will also settle accounts with them," he said.
Turkey's main stock exchange has dropped by 6.43 percent on opening on Monday, as investors worried about the destabilizing effect of the demonstrations on the economy.
Erdogan played down its significance, saying: "It's the stock market, it goes down and it goes up. It can't always be stable."
He rejected any comparison to the Arab Spring uprisings.
"We already have a spring in Turkey," alluding to the nation's free elections. "But there are those who want to turn this spring into winter.
"Be calm, these will all pass," he said.
In Iraq meanwhile, Prime Minister Nouri al-Maliki said in comments posted on his official website that his government was worried about the security implications of the situation in Turkey, saying the country was "an essential part of the stability of the region."
"We believe that resorting to violence will widen the circle (of violence) ... in the region, and we call for restraint," he said.
Iraq and Turkey share a long, mountainous border. Iraq is home to an ethnic Turkomen minority, centered around the disputed Iraqi city of Kirkuk, whose well-being has long been a concern for Ankara.
The two countries' relationship is increasingly strained over growing Turkish ties to Iraq's largely autonomous northern Kurdish region, and over Turkey's support for the Sunni rebels fighting to topple the Syrian regime. The Syrian civil war is exacerbating sectarian divisions within Iraq, and Baghdad has warned that the fall of the Iranian-backed Syrian government could ignite a wider conflict in the region.
Associated Press writer Adam Schreck in Baghdad contributed to this report.