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.
The government of Erdogan's Justice and Development Party (AKP) also blocked Twitter and YouTube in March 2014 after they were used to spread a torrent of audio recordings implicating Erdogan and his inner circle in a corruption probe.
For the latest tech news and reviews, follow Gadgets 360 on X, Facebook, WhatsApp, Threads and Google News. For the latest videos on gadgets and tech, subscribe to our YouTube channel. If you want to know everything about top influencers, follow our in-house Who'sThat360 on Instagram and YouTube.