Court stood by decision to sentence demoted soldier Elor Azaria to 18 months in prison for killing wounded Palestinian.

An Israeli military court on Sunday upheld the 18-month sentence of a soldier convicted of fatally shooting a Palestinian attacker who lay on the ground wounded after stabbing and wounding another soldier, in a case that has divided the country where military service is mandatory.

Sgt. Elor Azaria, an army combat medic, was recorded on a mobile phone video as he fatally shot a badly wounded Palestinian who had allegedly attacked a soldier with a knife beforehand, wounding him.

The Palestinian, Abdel Fattah al-Sharif, was lying on the ground unarmed when Azaria shot him in the head.

The 2016 incident occurred in the volatile city of Hebron in the West Bank.

Israel’s top generals pushed for the prosecution of the soldier they say violated the military’s code of ethics they hold dear.

Large segments of the public, including politicians on Israel’s nationalist right, sided with Azaria. Some called him a hero who was being wrongly persecuted.

READ MORE: ‘They killed him because he was an Arab’

Speaking from outside the military court in Tel Aviv, Al Jazeera’s Imran Khan said that this case had “polarised Israeli society.”

“The army says that Azaria was in violation of rules of engagement, while the left-wing say this is simply about the dehumanization of Palestinians, or a symptom of a much wider national psyche here,” Khan said.

In Israel, military service is compulsory for most Jewish men, and soldiers enjoy widespread sympathy and support.

Israel’s Defence Minister Avigdor Lieberman issued a statement urging the soldier’s family not to continue appealing. “It’s a difficult day,” he said adding the ruling must be respected.

He said the military’s Chief of Staff should be asked to pardon him. “I have no doubt he will take into consideration the difficult circumstances,” he said.

Other ministers also called for the soldier to be pardoned.

Leah Tsemel, an Israeli lawyer, said that Azaria’s sentencing is a “very light one”.

“Under these circumstances, I would say that any Palestinian youngster in Issawiyeh who throws stones at Israeli soldiers would be very happy to get this year and a half in prison,” she told Al Jazeera, referring to a town in occupied East Jerusalem.

However, she said that the message behind the court’s decision was still important.

“The message that comes out of the military court says there should be some sanity in the attitude of the army towards Palestinians,” she said. “We are not in the Wild West.”

READ MORE: Azaria exposed the reality of Israel’s colonial project

Human Rights Watch welcomed the court decision. “Upholding the conviction of a soldier convicted of fatally shooting a man who posed no threat sends an important message about restrictions on lethal use of force,” said Sari Bashi, the Israel and Palestine advocacy director at Human Rights Watch.

Israel has been coping with Palestinian attacks that erupted in 2015 which at times were a daily occurrence.

Since then, Israeli forces have killed more than 256 Palestinians; Israel has said that most of them were attackers, others died in clashes.

During that same period, Palestinians have killed 48 Israelis, two visiting Americans and a British tourist in stabbings, shootings and car-ramming attacks targeting civilians and soldiers.

Israel blames the violence on incitement by Palestinian religious and political leaders compounded on social media sites that glorify violence and encourage attacks. Palestinians say the attacks stem from anger and frustration at decades of Israeli occupation.