ANKARA (Reuters) - A man who depicted Tayyip Erdogan as the ‘Lord of the Rings’ character Gollum was convicted of insulting the president on Thursday and warned he faced a year in jail if he committed another crime, the Hurriyet newspaper reported.

Turkish President Tayyip Erdogan addresses a news conference at State House in Nairobi, Kenya June 2, 2016. REUTERS/Thomas Mukoya

A court in the southwestern province of Antalya sentenced Rifat Cetin - who likened Erdogan on social media to the “small, slimy creature” immortalized in J.R.R. Tolkien’s fantasy novels - to a year in jail, suspended for five years.

Under Turkish law, the offense is punishable by up to four years in prison.

Prosecutors have accused more than 1,800 people, including cartoonists and a former Miss Turkey, of insulting Erdogan, who has dominated - and polarized - Turkish politics for a decade and a half.

The court also stripped Cetin of his parental custody rights, Hurriyet said, without giving details. A court official declined to comment on the case when contacted by Reuters.

Cetin posted an image on Facebook in 2014 in which he combined three pictures of Erdogan with Gollum, the newspaper said.

Cetin told another newspaper, daily BirGun, he planned to appeal the verdict given that Erdogan was not president, but prime minister, at the time the image was posted.

Gollum appears in Tolkien’s tale “The Hobbit” and his “Lord of the Rings” trilogy, which have been turned into blockbuster movies.

The creature is portrayed as both an antagonist of Tolkien’s heroes, the hobbits Bilbo and Frodo Baggins, and a victim of the most powerful of the trilogy’s eponymous rings, which has twisted his mind and body.

Doctor Bilgin Ciftci is being tried for sharing an identically juxtaposed Facebook picture, his lawyer said in December.