ISTANBUL — Turkish authorities say they have restored access to YouTube five days after the country’s highest court ruled that the two-month ban on the video-sharing website violates freedom of expression.

Turkish news reports said that the court’s decision was delivered to the country’s telecommunications regulator Tuesday. YouTube became accessible later in the day.

The restrictions on YouTube were imposed in late March after the leak of an audio recording of a government security meeting. In the recording, senior officials appeared to be discussing a possible military intervention in Syria.

A lawyer representing YouTube, the Turkish Bar Association and legislators from Turkey’s main opposition party appealed to the high court, seeking to overturn the ban that they said was unconstitutional.

Turkey also blocked access to Twitter in March — hours after Erdogan threatened to “rip out the roots” of the micro-blogging site. But early last month, the high court also ordered Turkish authorities to end the ban on Twitter.

The moves by Turkish authorities to block the social media networks have provoked widespread criticism by Western governments and human rights organizations.

Following the Twitter ruling, Erdogan said his government would comply, even though it did not respect the decision.

Many tech-savvy users, including Erdogan ally President Abdullah Gul, found ways to circumvent the bans both on Twitter and YouTube while they were in place.

Otto Warmbier was arrested in January 2016 at the end of a brief tourist visit to North Korea. He had been medically evacuated and was being treated at the University of Cincinnati Medical Center when he died at age 22.