A Turkish court has ruled that a blanket ban of social media website YouTube violated human rights and ordered most of the restrictions be lifted.
The decision of Friday comes after a top court ruling this week that scrapped a similar ban on microblogging site Twitter.
The government blocked access to YouTube, Google's video-sharing site, after anonymously leaked audio recordings appeared there, purportedly showing senior officials discussing a possible attack on Syria ahead of an election.
Access to Twitter had been similarly barred until the Constitutional Court on Thursday ruled that violated the law. The court in the capital Ankara said the YouTube ban was too broad and instead specifically blocked access to 15 videos, a copy of the court document showed.
Turkish Prime Minister Recep Tayyip Erdogan criticised the decision to repeal the ban on Twitter saying that he would comply with the ruling but would not "respect it", according to Reuters news agency.
Both social media sites were being used to spread a leaked conversation between government, military and intelligence officials. In the recording, officials said to include the head of Turkey's intelligence service Hakan Fidan and Foreign Minister Ahmet Davutoglu discussed intervention in Syria.
Erdogan and his aides have accused the Hizmet movement led by US-based cleric Fethullah Gulen of running a "dirty campaign" against him in the run-up to last Sunday's local elections.
Gulen, a former ally of the Turkish prime minister, has influence in the police and judiciary. He has denied involvement in the leaks but those close to him fear a crackdown after Erdogan's AKP's resounding performance in the vote.
After the elections results, Erdogan said in a speech in front of his supporters that he would bring to account those who "threaten national security".