BAKU, Azerbaijan —A novella by an Azeri author that portrays ethnic Armenians sympathetically has provoked an uproar in Azerbaijan, with Azeri lawmakers denouncing the work and protesters burning the author’s portrait outside his house.

The novella, “Stone Dreams,” was published in mid-December by Ekrem Eylisli, a former lawmaker, but condemnation grew strident only over the last week, after mainstream news outlets began reporting on and discussing it.

On Thursday, a crowd of several dozen people gathered around Mr. Eylisli’s house and burned his portrait. At a session of Azerbaijan’s Parliament on Friday, lawmakers attacked the novel, with one recommending that Mr. Eylisli be stripped of his citizenship and urging him to move to Armenia.

Another lawmaker, Melahet Ibrahimqizi, said, “He insulted not only Azerbaijanis, but the whole Turkish nation,” a reference to passages in the book that discuss historical Turkish violence toward Armenians.

The work tells the story of two Azeri men who try to protect their Armenian neighbors from ethnic violence, an incendiary topic in Azerbaijan, a country still gripped by the war it fought two decades ago with Armenia. Since the war ended, Azerbaijan has been trying to regain control of Nagorno-Karabakh, a predominantly ethnically Armenian enclave within its borders, and secure the return of Azeris who were forced from their homes.

Mr. Eylisli, 75, said he knew there might be an uproar over his book, which he finished in 2007. He said he decided to publish it last year in a relatively obscure Russian-language journal, Friendship of Peoples, because Russian-language speakers tend to be better educated and more progressive.

“Armenians are not enemies for me,” he said in an interview. “How can they be? I am a writer living in the 21st century. A solution to Nagorno-Karabakh is being delayed, and hostility is growing between the two nations. I want to contribute to a peaceful solution.”

He added that he was shocked by the ferocity of the reaction. “I did not say anything insulting, I did not betray my country,” he said. “I describe how an Azerbaijani helps an Armenian. What is bad about this?”

On Friday, protesters placed a copy of the journal containing “Stone Dreams” in a coffin and held a mock funeral at a monument in honor of Azeris who were killed in the war.

Via social media, young people discussed passages in the book that they found particularly distasteful, like a description of the young hero’s impulse to convert to Christianity and “ask God to forgive Muslims for what they did to the Armenians.” Armenia is predominantly Christian, while most Azeris are Muslim.

Qan Turali, 28, a popular novelist, said he saw the book’s artistic merit but believed that Mr. Eylisli had chosen the wrong time to publish a book portraying Armenians in a positive light.

“He is a great writer, the novel is good, but the time is not right,” he said. “Azeri people still feel pain and are aggressive. Instead of increasing tolerance toward Armenians, the writer caused more hatred.”

He said Mr. Eylisli’s work would have been received better if he had added depictions of Azeris being killed by Armenians. Another writer, Oktay Hajimusali, 32, was blunter, saying that it is “nonsense to promote peace with Armenians.”