Turkey's parliament has adopted a new Internet bill roundly criticised as an assault by Prime Minister Recep Tayyip Erdogan on freedom of expression, access to information and investigative journalism.

After hours of debate, the measures were adopted late on Wednesday where Erdogan's ruling Justice and Development Party (AKP) dominates with 319 of the 550 seats.

The text notably permits a government agency, the Telecommunications Communications Presidency (TIB), to block access to websites without court authorisation, if they are deemed to violate privacy or with content seen as "insulting".

The legislation would also force Internet providers to keep records on Web users' activities for two years and make them available to authorities when requested, without notifying the users.

The measures are part of a package of legislation, the rest of which is expected to be approved by Parliament on Thursday and then signed into law by President Abdullah Gul.

Under that existing legislation signed in 2007, websites including blogging tool Wordpress and video-sharing services DailyMotion and Vimeo have been blocked temporarily by court orders, while YouTube was off limits for two years until 2010.

Some alternative news websites cannot be accessed and people have been fined, jailed or given suspended sentences - like world-renowned pianist Fazil Say in 2013 - for tweets insulting religious values.

'Internet authoritarianism'

The proposals come amid parallel moves by Erdogan to push through contentious judicial reforms as he fights to keep the lid on a deeply damaging corruption probe entangling some of his closest allies.

At the start of the debate on Wednesday, opposition lawmaker Hasan Oren had harsh words, comparing Erdogan to Hitler. "When you came to power you talked of enhancing democracy in Turkey, now you are trying to implement fascism," Oren said.

Reporters Without Borders said the aim of the amendments were "to reinforce cyber-censorship, government control of the Internet and surveillance".

The Committee to Protect Journalists (CPJ) called it a "slide into Internet authoritarianism" in a country that is the "the leading jailer of journalists worldwide".

Even Turkey's Industry and Business Association was critical, saying the proposals "conflict with the principles of checks and balances" and would increase censorship and deter investors.