A Turkish doctor has been acquitted of "publicly denigrating" Turkey's president, Recep Tayyip Erdogan, by comparing him to the Lord of The Rings character, Gollum.

Bilgin Ciftci was acquitted by Aydin's Third Criminal Court on Tuesday of violating Article 301 of the Turkish constitution, which censures anyone who "publicly denigrates state officials, the government and the judicial institutions of the state".

Ciftci had posted three pictures of Gollum in various states such as in shock, surprised and while eating alongside pictures of Erdogan caught in similar poses:

Ciftci would have faced up to two years in jail if found guilty.

His lawyer, Hicran Danisman, welcomed the decision on Tuesday.

"We consider these kinds of cases as a means of silencing social opposition," he told the Evrensel newspaper. "It is a pleasing decision not only for the client, but also for society."

Gollum 'not evil' says panel of Turkish experts Read More »

Danisman said that his team had been forced to repeatedly rewatched the Lord of the Rings series in order to build their argument that Gollum was not "evil" and that the comparison with Erdogan was therefore not offensive.

"In this sense, we have saved Gollum's reputation," he explained.

The case had been a major headline in Turkey due to the questions it raised about the erosion of civil liberties in Turkey and threats to the freedom of the media.

Peter Jackson, the director of the Lord of the Rings trilogy and its prequel The Hobbit , argued the character depicted in the images was in fact Smeagol, the "good" aspect of Gollum's personality.

News just in: Turkish doctor Bilgin Çiftçi, put on trial for sharing a meme that compared President Erdoğan to Gollum, has been acquitted pic.twitter.com/pMuXuKlbt5 — Laura Pitel (@laurapitel) April 18, 2017

"If the images... are in fact the ones forming the basis of this Turkish lawsuit, we can state categorically: none of them feature the character known as Gollum,” Jackson said in a joint statement with filmmakers Fran Walsh and Philippa Boyens in 2015.

“All are images of the character called Smeagol, Smeagol is a joyful, sweet character. Smeagol does not lie, deceive, or attempt to manipulate others.

"He is not evil, conniving, or malicious - these personality traits belong to Gollum, who should never be confused with Smeagol."

Gollum (left) and Smeagol

The Turkish government imposed a state of emergency in the wake of the failed 15 July coup attempt against Erdogan, which critics say has been used for a massive clampdown on Erdogan's opponents and not merely suspected coup plotters.

According to journalists' associations, about 170 media outlets have been closed and nearly 800 press cards cancelled.

Turkey has also detained or expelled foreign correspondents for The New York Times, The Wall Street Journal, Die Welt, and the French website Les Jours.

More than 100 journalists and media contributors are in jail, said Reporters Without Borders in a December report, which said the country led a rise in journalist detentions in 2016.