Turkey's prime minister has told Al Jazeera that his country is freer than some states of the EU, in an interview held on the same day that more than 2,000 demonstrators clashed with riot police in Istanbul over new restrictions on the internet.

In an interview on Saturday, Recep Tayyip Erdogan referred to his government's tough response to widespread protests last year over plans to level Gezi Park in Istanbul, saying that the governments of Germany and the UK would have reacted the same way.

His comments came as a new wave of protests erupted on Istanbul's streets, this time over a new law signed that opponents say would allow the government to shut down websites to order. Riot police clashed with rioters who threw fireworks and daubed graffiti on buildings.

"Turkey is almost more free than some states of the European Union," Erdogan told Al Jazeera's Jamal Elshayyal. "When you refer to the Gezi Park events, why do you not see the events in Frankfurt, Hamburg? Have you seen what the police did there?"

"Why do you [not] see what happens in England?"

Hundreds of people were injured in anti-austerity riots in Hamburg and Frankfurt. In London in 2011, riot police put down unrest sparked by the shooting of an unarmed man. Many rioters prosecuted were handed the most severe punishment allowed by law.

"I am not saying two wrongs make one right. I am presenting you with examples," Erdogan told Al Jazeera. "We stand against damages done to public property. Our job is to take measures to establish peace and order."

Wave of anger

Turkey's president, Abdullah Gul, is under pressure not to ratify the internet legislation, passed on Wednesday by parliament, which would allow authorities to block websites for privacy violation without a court decision.

Internet providers would also be forced to keep users' data and make it available to authorities.

Erdogan, Turkey's prime minister since 2008, has rejected accusations of censorship, insisting the legislation would make the internet "more safe and free".

Addressing a crowd of several thousand supporters in Istanbul on Saturday, he said: "These regulations do not impose any censorship at all on the internet. On the contrary, they make it safer and freer."

He also denied that authorities would now have access to internet users' personal information.

"Never. It is out of the question that people's private data will be recorded," Erdogan said.

Human Rights Watch said the restrictions raised concerns that a "defensive government is seeking to increase its power to silence critics and to arbitrarily limit politically damaging material online".

Martin Schulz, European Parliament chief, called them a "step back in an already suffocating environment for media freedom", while the US also expressed misgivings.