Strasbourg (France) (AFP) - The European Court of Human Rights ruled on Tuesday that Turkey had violated conventions on freedom of expression when it banned YouTube for more than two years.

An Ankara court had barred access to the video-sharing site from May 2008 to October 2010 over 10 videos deemed insulting to modern Turkey's founding father Mustafa Kemal Ataturk, the Strasbourg-based rights tribunal said.

"Blocking without a legal basis users' access to YouTube infringed the right to receive and impart information," it said, ruling on a case brought by three Turkish law professors.

"The court also found that there was no provision in the law allowing the domestic courts to impose a blanket blocking order on access to the Internet, and in the present case to YouTube, on account of one of its contents."

The lengthy ban on YouTube -- and thousands of other websites -- had prompted widespread concern about freedom of expression under then prime minister and now President Recep Tayyip Erdogan, who critics say has become increasingly authoritarian.

Before the ban, YouTube had been the fifth most popular site in Turkey.

Erdogan and the ruling Justice and Development Party (AKP) have been repeatedly criticised for using court orders to block critical websites, topping a Google table for content removal requests.

Last year the search engine also accused Turkey of intercepting its Internet domain, redirecting users to other sites.

The government blocked Twitter and YouTube in March 2014 after they were used to spread a torrent of audio recordings implicating Erdogan -- then premier -- and his inner circle in an alleged corruption scandal.

Turkey's parliament in March also approved legislation to tighten the government's control over the Internet by allowing it to block websites without prior judicial authorisation, sparking outrage both at home and abroad and a condemnation from the country's Constitutional Court.

Erdogan has also made no secret of his disdain for social networks, comparing them to a "murderer's knife" and once famously vowing to "eradicate" Twitter.

The European court said in its ruling Tuesday that "YouTube was a single platform which enabled information of specific interest, particularly on political and social matters, to be broadcast.

"It was therefore an important source of communication and the blocking order precluded access to specific information which it was not possible to access by other means."