A Jerusalem man was sentenced to 16 months in prison for slaughtering a donkey and hanging its head on a fence inside a Muslim cemetery in Jerusalem about 18 months ago, according to a court ruling issued Tuesday.

The defendant, who was under house arrest at the time, bought a young donkey, tied its legs, transported it in the trunk of a car to the cemetery near the Gate of Mercy, decapitated it with an axe and hung its head on a fence inside the Bab al-Rahma Muslim cemetery, the ruling said.

During the trial, the man claimed he acted out of religious belief, saying he was fulfilling the commandment of “petter chamor,” a Jewish ritual involving the redemption of a firstborn donkey.

The Jerusalem District Prosecutor’s Office rejected the defense, arguing that the act was not protected under religious freedom and warning that recognizing such a justification could set a dangerous precedent. Prosecutors said the defendant knew his actions could offend religious sensitivities.

The court accepted the prosecution’s position and dismissed the man’s claims.

Prosecutors described the act as premeditated, carried out in violation of release conditions, motivated by religious ideology and committed during a period of heightened security tensions.

They requested 22 months in prison, a significant suspended sentence and a fine payable to an animal welfare fund. They also asked that six months the defendant served in a separate case not be deducted from the sentence in this one. The court granted both requests.

“Harming animals, especially abusing and killing them, is a serious offense marked by cruelty toward the vulnerable,” the court wrote. “A decent society cannot and should not tolerate such behavior.”