Turkey's top court has ruled that a blanket ban on YouTube violated individual rights and freedoms, clearing the way for the popular video-sharing site to come back.
The decision on Thursday was in response to individual complaints to the constitutional court on the grounds of a breach of rights, an official from the prime minister's office told AFP news agency.
The ruling is a setback for Turkish Prime Minister Recep Tayyip Erdogan, who had advocated the ban of the website and its videos.
"The decision by Turkey's highest court to lift the ban on YouTube would be greeted warmly by advocates of free speech and political independents here in Turkey," Al Jazeera's Anita McNaught, reporting from Istanbul, said.
YouTube has been banned in Turkey since March 27 after the site was used to spread audio recordings in which senior government, military and intelligence officials were allegedly heard weighing possible military action inside war-torn Syria.
The court's decision is "binding" and access to YouTube could be granted in the coming hours, the private NTV television channel reported.
Last month, the government said it would keep its block on YouTube in place despite two separate courts ordering the ban be lifted.
In March, Turkey also blocked Twitter after it was used to spread a spate of anonymous leaks implicating Prime Minister Erdogan and his inner circle in corrupt deals.
But the government had to comply with a constitutional court ruling that found the two-week ban on the microblogging site violated free speech.
The latest ruling is seen as another slight to Erdogan, who has accused the judiciary of "showing increasing appetite in the political sphere".
The constitutional court has provoked the wrath of the government, especially after overturning the Twitter ban and annulling parts of a ruling party-sponsored law tightening the grip of the executive over the judiciary.
Erdogan has claimed Turkey's judiciary and police are under the sway of his ally-turned-rival Fethullah Gulen, an influential Muslim cleric based in the United States.
The ban on Twitter and YouTube was seen by Erdogan's critics as an attempt to prevent further details from the corruption scandal being leaked online as part of a campaign waged by Gulen and his loyalists to unseat his government.
Gulen is believed to have an extensive network of supporters in the police and the judiciary but denied claims that he has masterminded the corruption scandal against the prime minister and his allies.