A Chinese author of erotic fiction has been sentenced to more than 10 years in jail for writing and selling a novel that featured gay sex scenes.

Key points: The book is about a sexual relationship between a student and a teacher

The book is about a sexual relationship between a student and a teacher Pornography is illegal in China, and regulators have been cracking down on it

Pornography is illegal in China, and regulators have been cracking down on it Some social media users are criticising the length of the jail sentence

The female writer, who uses the pen name Tianyi but was identified in state media by her surname Liu, published the book Occupy in 2017, and sold it through Chinese online shopping site Taobao.

The state-owned Global Times newspaper reported Liu's novel featured what it called "obscene sexual behaviour between males," and was "full of perverted sexual acts like violence and abuse".

The book was about a sexual relationship between a school student and his teacher, according to the South China Morning Post.

Pornography is illegal under China's 20-year-old criminal law, which prohibits pornographic books, videos and audio content.

Local media reported police arrested Liu in November last year, and that she confessed to writing the book.

According to the report, Liu told police she made 150,000 yuan ($30,000) profit selling Occupy and other erotic books, which she had promoted on Chinese social media site Weibo.

A court in China's Anhui province sentenced her to 10 years and six months in jail for the crime of making and selling obscene articles for profit.

Four other people involved in the publication of the book also received jail sentences. ( Supplied )

While the writer was sentenced on October 31, details of the hearing only emerged in Chinese media this week.

Four other people involved in the publication of the book also received jail sentences ranging between 10 months and 10 and a half years, as well as fines.

Liu and one other person are reportedly appealing against the sentence, according to The Beijing News.

'Should be guilty in every country'

The length of the sentence was questioned on Chinese social media.

One Weibo user, who said she had been the victim of a sexual assault in Beijing last year, pointed out the man who attacked her only received an eight-month prison sentence for the crime.

Li Yinhe, a well-known sexologist with more than 2 million followers on the site, said the jail sentence was excessive.

"The author deserves sympathy. She did violate criminal law, but even a one-year sentence is too much, not to mention 10 years," she wrote.

Others however said they thought the book's explicit content justified the sentencing.

"[The author] should be guilty in every country of the world. This is a book publicising homosexuality to children," one user wrote.

Some Chinese publications have linked the book to the Boys' Love genre of books, comics and television shows, which has been gaining popularity across Asia.

Fans of the genre, which traces its origins to Japan, are overwhelmingly heterosexual women. The authors are also mostly female.

Liu's sentencing comes amid a larger crackdown on pornography in China.

Last week, regulators doubled the reward money given to citizens who report pornographic content to police — $118,000 is now up for grabs.

In the same week, China's top cyber authority also wiped almost 10,000 accounts from various social media sites, accusing them of posting vulgar and "politically harmful information".