An Israeli soldier was sentenced Tuesday to 18 months in prison for fatally shooting an injured Palestinian assailant – a show of leniency that drew Palestinian condemnation after a yearlong saga that divided the country.

Judge Maya Heller imposed the sentence a month after Sgt. Elor Azaria, 21, was found guilty of manslaughter for killing Abdul Fatah al-Sharif as he lay on the ground in the southern occupied West Bank last March.

Azaria, a combat medic, was seen on cellphone video as he shot al-Sharif in the head after the Palestinian stabbed another soldier in Hebron. The video was taken by a Palestinian human-rights activist.

Another stabber, Ramzi Aziz al-Qasrawi, was killed during the attack on March 24, 2016, which left one soldier lightly wounded.

A smiling Azaria entered the military courtroom at the Israel Defense Forces headquarters in Tel Aviv to applause and hugs from his family and well-wishers.

His father and mother, who sat on either side of him, listened intently as Col. Heller imposed the 18-month prison term, demoted him to private and added two suspended sentences — 12 and six months, the Times of Israel reported.

Heller said the three-judge panel had taken into account mitigating factors including the “harm suffered by his family” and the fact Azaria was in “hostile territory” during the incident.

She added, however, that he had not expressed remorse for his actions., Agence France-Presse reported.

Azaria’s relatives and supporters then sang Israel’s national anthem, the “Hatikvah,” and called him a hero.

Chief prosecutor Lt. Col. Nadav Weisman said the jail term would send a message to commanders about upholding the IDF’s values.

“We know this was not an easy day for the accused and his family, but justice needed to be done and justice was done,” he said.

Azaria garnered much support among the public, many of whom have considered him a scapegoat for a misguided elite that has sought to severely punish a soldier who justly responded to an attacker trying to kill fellow soldiers.

Prosecutors had asked for a prison term of three to five years while Palestinians dismissed the sentence as a “joke.”

Several politicians and officials called for Azaria – who is to start serving his term on March 5 — to be pardoned immediately. But some predominantly left-wing politicians denounced the punishment as a slap on the wrist.

“The court said its piece, the legal process is done. Now is the time for clemency, to return Elor to his home,” Transportation Minister Yisrael Katz of the Likud party wrote on Facebook.

Education Minister Naftali Bennett, leader of the nationalist Jewish Home Party, said: “Even if he erred, Elor should not sit in prison. We will all pay the price.”

Defense Minister Avigdor Liberman, who earlier called for a pardon, wrote on Facebook: “Now, after the sentencing, I hope that the two sides will do what is necessary to finish this issue for good… As I’ve said in the past, even those who don’t like the verdict or the sentence are bound to respect the court, and as I’ve also said, the military must stand at the side of the soldier and his family.”

Left-leaning Meretz Minister Tamar Zandberg voiced her dissatisfaction on Facebook.

“They sentenced [Azaria] to just a year and a half in prison. Azaria needed to be punished, and seriously,” she wrote.

One of Azaria’s lawyers decried what he considered a harsh sentence.

“The prosecution was thirsty for Elor’s blood and the sentencing proves that,” Yoram Sheftel said outside the court.

Human Rights Watch said in a statement that “sending Elor Azaria to prison for his crime sends an important message about reining in excessive use of force.”

A source close to President Reuven Rivlin, who could hand down a pardon, told the Times of Israel that no such request had been made yet.

The Palestinians, meanwhile, said the light sentencing only encouraged Israeli soldiers to use excessive force.

“This sentence is a joke, and it shows how much discrimination Israeli courts practice against Palestinians,” said Issa Karaka, the Palestinian government minister for prisoners.

The dead Palestinian’s father, Yousri al-Sharif, said the sentence made a mockery of justice.

“If one of us killed an animal they would have put him in jail for God knows how long. They are only making fun of us,” he said.

Fathi al-Sharif, an uncle of the slain man, also assailed the sentence as too light.

“It’s not a punishment,” he said. “This will encourage other soldiers to do the same.”

Sari Bashi of Human Rights Watch said sending Azaria to prison “sends an important message about reigning in excessive use of force.”

“But senior Israeli officials should also repudiate the shoot-to-kill rhetoric that too many of them have promoted, even when there is no imminent threat of death,” he said. “Pardoning Azaria or reducing his punishment would only encourage impunity for unlawfully taking the life of another person.”

Prime Minister Benjamin Netanyahu, who called for Azaria to be pardoned after he was found guilty, later softened his stance and called Azaria’s parents to console them.

Netanyahu was on a trip to Singapore and Australia and did not immediately react to the sentencing.

The case helped lead to the resignation of Defense Minister Moshe Yaalon, a former military chief of staff who sided with the army.

Azaria has already spent 10 months in detention at an Israeli military base, but that time will not count toward his sentence, the Israeli paper reported.

The shooting occurred at the height of what has become more than a yearlong wave of Israeli-Palestinian violence.

Since September 2015, Palestinian attackers have carried out several stabbing and shooting attacks that have killed 41 Israelis and two visiting Americans. During the same time, Israeli forces have killed 235 Palestinians.

With Post Wires