ISTANBUL - A Turkish court on Wednesday lifted a ban on Wikipedia after almost three years.

Turkey was the only country in the world apart from China to entirely block access to the online encyclopedia.

But its constitutional court ruled last month that the ban, in place since April 2017, violated freedom of expression.

Court Rules Turkey Violated Freedoms by Banning Wikipedia Access to Wikipedia and all its language editions was blocked under a Turkish law that allows the government to ban websites it deems pose a national security threat

Turkish officials said in 2017 that the ban was needed as Wikipedia had failed to remove content accusing its government of assisting terrorist groups.

Rights groups have regularly criticized the erosion of free speech in Turkey under President Recep Tayyip Erdogan, especially since a failed coup attempt in 2016 triggered a massive crackdown on government critics in the press and beyond.

An Ankara judge gave the order on Wednesday for the ban to be lifted by the telecommunications watchdog.

Users said the website was still inaccessible on Wednesday though it was expected to be gradually unblocked nationwide.