A Turkish court on Wednesday lifted a ban on Wikipedia after almost three years, AFP reports.

The ban was first imposed in April of 2017, when Turkish officials said a ban was needed as Wikipedia had failed to remove content accusing its government of assisting terrorist groups.

Wikipedia appealed the ban but a Turkish court rejected the appeal, arguing that while freedom of speech was a fundamental right, it can be limited in cases where there is a "necessity for regulation".

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

Its constitutional court ruled last month that the ban violated freedom of expression.

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

Users in Ankara and Istanbul said late Wednesday the website was now accessible.

Turkey regularly blocks access to websites and has in recent years tightened government control of the Internet and the judiciary, generating criticism from rights groups.

In 2015, the country blocked access to Twitter over the sharing of photographs of a prosecutor being held at gunpoint by far-left militants.

In January of 2015, the country blocked access to all sites which carried the front page of the French satirical magazine Charlie Hebdo, which featured a cartoon of Mohammed following the massacre at the magazine's office by Muslim terrorists.

In 2014, after briefly banning all access to Twitter, President Recep Tayyip Erdogan vowed to "eradicate" the social media site.