Turkey's highest court ruled on Thursday that a block on access to video-sharing website YouTube , imposed by Prime Minister Tayyip Erdogan's government two months ago, was a violation of rights, local media reported.

Blocks on access to YouTube and Twitter were imposed after audio recordings, purportedly revealing corruption in Erdogan's inner circle, were leaked on the sites. The block on access to Twitter was lifted in April.

Turkish authorities have so far defied orders from lesser courts and upheld the YouTube ban, saying some of the offending content had not been removed from the site. There was no immediate comment from Turkey's telecoms regulator on whether it would now lift the ban.

The ban on YouTube was imposed on March 27 in the build-up to local elections after an illicit audio recording was leaked of top security officials discussing possible military intervention in Syria.

Erdogan condemned that recording, which followed a series of other leaked wiretaps, as an act of treason. He later emerged from the local elections with his popularity largely intact.

Erdogan accused a U.S.-based Islamic cleric of using a network of supporters to orchestrate the internet campaign and a police corruption investigation to undermine him. The cleric, Fethullah Gulen, has denied any involvement.

The prime minister said on Wednesday that Gulen's network might now leak a video about him and his family in a bid to smear him ahead of an August presidential election in which he is widely expected to stand.

