Turkey’s parliament has passed legislation which toughens government control over the internet. Critics say PM Tayyip Erdogan's government is attacking freedom of expression and investigative journalism with the move.

The bill, which is yet to be signed into law by the Turkish president, would allow the authorities to block websites without a court order within just hours. It also requires that internet service providers (ISPs) store data on their clients’ online activities for two years and provide it to the authorities on request.

The legislation amends Turkey’s law 5651 of 2007, which already gives the government authority for online censorship. It allows the blocking of websites violating Turkish law. The prohibited content includes criticism of Mustafa Kemal Atatürk, the founder of modern Turkey, promotion of suicide, online gambling available for minors and pirated media.

Among the sites blocked or fined under the law were video sharing services YouTube and Vimeo, blogging tool Wordpress and several online media outlets.

The new bill was passed late Wednesday by the parliament dominated by the Erdogan’s AKP party, is part of a package. The package is meant to consolidate government’s power amid a corruption inquiry, which the prime minister calls a "judicial coup" against his government.

Erdogan previously expressed suspicion over Internet and social media, branding Twitter a "scourge" for helping organize mass nationwide anti-government protests in June.

As the amendment was debated, some opposition legislators compared Erdogan’s actions with those of Nazi Germany leader Adolf Hitler, who was elected into power in a democratic election only to transform the country into a militaristic powerhouse under his rule.

“When you came to power you talked of enhancing democracy in Turkey – now you are trying to implement fascism,” opposition MP Hasan Oren charged.

"This is against the constitution,” fellow opposition legislator Umut Oran said. “Bans like this exist in times of coups and have not been able to conceal any corruption."

The governing AKP party dismisses the accusation of conduction an attack on freedoms.

"The latest regulations are not censorship and are not a ban," party deputy Necdet Unuvar said in comments on his personal website. "They are regulations needed to protect the confidentiality of private life."

Turkish activists rallied against the bill in mid-January shortly after it was announced. The protest was dispersed by riot police, who used water cannons and tear gas against hundreds of opponents of the bill. Activists are planning a new protest against the legislation on Saturday.

In January, Turkey passed controversial legislation forbidding the provision of emergency first aid without a government license, punishable by up to three years in prison and a heavy fine. Critics of the government say the law is part of a crackdown on protests, as it outlaws discreet medical treatment of activists injured in clashes with the police.