The Turkish government has been accused of imposing draconian censorship after pushing harsh new internet curbs through parliament. The internet law was met with outrage in Turkey on Wednesday night, with opposition parties accusing the government of wanting to introduce ever tighter control by bypassing the courts.

The regulations were adopted after a heated parliamentary debate on Wednesday, during which one MP of the main opposition People's Republican party (CHP) compared the Turkish prime minister, Recep Tayyıp Erdoğan, to Hitler. The law now needs to be signed by the Turkish president, Abdullah Gül, to come into effect.

"When you came into power you talked of increasing democracy in Turkey, but now you are trying to implement fascism," Hasan Ören said. "Remember that Adolf Hitler used the same methods when he rose to power."

The new measures will allow Turkey's telecommunications authority (TIB) to block any website within four hours without first seeking a court ruling. The law also obliges internet providers to store all data on web users' activities for two years and make it available to the authorities upon request.

The deputy prime minister, Bülent Arınç, rejected talk of censorship. "We are freer and have more press freedom than many other countries in the world," he said.

However, critics say the law violates citizens' rights to freedom of expression and current privacy rights, turning Turkey into an Orwellian surveillance state.

"The new internet law is catastrophic for Turkey," said Özgür Uçkan, professor at the communications department of Istanbul's Bilgi University and member of the Alternative Informatics Association. "It makes censorship and surveillance legal in Turkey, which is contrary to our constitution and to all international conventions that Turkey is party to."

He warned that the new regulations gave almost unlimited powers to Turkey's telecommunications authority: "The law will turn the TIB into an NSA-like body. What is more is that any bureaucrat can now decide to take down a certain website without having to apply for a court order, but you will need to take that decision to court in order to get it reversed."

Censorship and a very tight control of the internet are already a reality in Turkey. According to Engelliweb.com, around 40,500 websites were blocked in Turkey by the beginning of February – 10,000 more than in April last year. The latest Freedom of the Net" report published by Freedom House describes the Turkish internet as "partially free".

Human rights groups have also expressed their concern about the new law.

"It is worrying that the law puts control over the internet further in the hands of the government and away from judicial oversight," said Andrew Gardner, Turkey researcher for Amnesty International. "And the government has already shown itself to have very little tolerance towards dissent and opposing opinions."

He added that the law would also facilitate a more targeted censorship, such as of individual Twitter profiles.

Social media played a major role during last summer's anti-government protest, prompting Erdoğan to call Twitter "a menace to society".

"Economically the law is also a catastrophe," Uçkan said. "All secret company data will be accessible to the state. Companies who can afford it will move their operations elsewhere."

• This article was amended on 9 February to make it clear that the new measures allow websites to be taken down within four hours, not 24 as originally stated