Image copyright iStock Image caption The book featured "male homosexual behaviour... including perverted sexual acts like violation and abuse"

A Chinese writer has been given a 10 year sentence for writing and selling a novel which featured gay sex scenes.

The writer, identified as Liu, was jailed by a court in Anhui province last month for producing and selling "obscene material".

Her novel, titled "Occupation", featured "male homosexual behaviour... including perverted sexual acts like violation and abuse."

But her lengthy jail term has sparked protest across Chinese social media.

According to the Beijing News, Liu - better known by her online alias Tian Yi - has now filed an appeal to the court.

Pornography is illegal in China.

'Too much'

On 31 October, Liu was sentenced to jail by the People's Court of Wuhu for making and selling "obscene material" for profit, according to local news site Wuhu news.

However, details of the hearing only emerged on Chinese media outlets this week.

Police officials were first alerted to her novel after it started to gain popularity online.

Liu is said to have sold over 7,000 copies of Occupation and other erotic novels and made 150,000 yuan ($21,604, £16,782) in profit, reported state news outlet the Global Times.

But many social media users argued that the sentence she received was excessive.

"10 years for a novel? That's too much," said one social media user on Weibo.

Another referenced an incident in 2013, where a former official was sentenced to eight years in prison for raping a four year old girl.

"Those found guilty of rape get less than 10 years in jail. This writer gets 10 years," another Weibo user added.