A man had complained that Naji's writings caused him heart palpitations, sickness and a drop in blood pressure. Prosecutors took the case to court, arguing that Naji's use of "vulgar" phrases to describe genitals and sexual intercourse constituted a "disease destroying social values."
"Citizens can't bring such cases to court without proving a direct and personal link to the action in question," Mahmoud Othman, one of Naji's lawyers, told CNN. Instead, prosecutors have been framing their cases as an offense to public morality, he said.
Nasser Amin, another lawyer for Naji, described Saturday's verdict as shocking, especially since a lower court had acquitted the writer in December.
"It's expected that a lower court would issue a guilty verdict in such cases which would be overturned by a higher court, not the other way around," Amin told CNN.
Rights groups said it is part of a worrying trend of prosecuting intellectuals and artists in Egypt.
"The continuation of such policies would increase fears that people of different viewpoints and fiction [writers] would be thrown in prison for the mere expression of these opinions in any format," a number of Egyptian rights organizations said in a joint statement following Naji's sentence."
Naji was arrested on the spot Saturday and transferred to prison. His lawyers filed a request to suspend the sentence until they file the last appeal.
Tarek El-Taher, the editor of the state-run magazine that published the excerpt of Naji's novel last year, was fined $1,250.
Other artists and writers prosecuted
Saturday's verdict is the fourth against an Egyptian writer or artist in the recent months.
Film producer Rana El-Sobky was sentenced to a year in prison for "violating public modesty" in a film released in theaters.
Poet Fatma Naoot was sentenced to three years in prison for contempt of religion for a post she wrote on Facebook. Both have appealed their sentences.
TV presenter Islam El-Beheiry is serving a yearlong prison sentence after he was found guilty of contempt of religion for questioning traditional interpretations of Islamic teachings.