RIYADH, Saudi Arabia — A Palestinian poet condemned to death in Saudi Arabia for apostasy has had his sentence reduced to prison time and lashes instead, his lawyer said Tuesday.

Ashraf Fayadh was sentenced to death in November by a court in the southwestern city of Abha. He faced charges including blasphemy, spreading atheism and having illicit relationships with women.

His defense lawyer, Abdulrahman al-Lahim, said in a statement posted online that an Abha court has quashed the death sentence and issued a new appeals verdict of 800 lashes and eight years behind bars. The lashes are to be meted out 50 at a time. Fayadh must also publicly repent and denounce his works in the media, the lawyer said. The attorney said he intends to formally object to the latest ruling.

The court’s decision is the latest twist in an ordeal that has been condemned by freedom of expression advocates.

Fayadh’s death sentence was issued on appeal following an earlier verdict of 800 lashes and four years in prison. Judges issued the death sentence after throwing out earlier defense witness testimony and refusing to accept his repentance.

In the days after he was sentenced to death, Fayadh was quoted by a local news website denying that he is an atheist and contending that his case centered on a personal dispute.

United Nations special rapporteur on freedom of expression and opinion David Kaye in December urged Saudi authorities to free Fayadh along with detained rights activist Mikhlif al-Shammari and blogger Raif Badawi as he warned of “growing repression” in the kingdom.

PEN America, a group promoting literature and freedom of expression that has followed Fayadh’s case, expressed relief that the artist no longer faced execution but said his punishment nonetheless “extends the injustice” against him.