TEL AVIV, Israel -- An Israeli soldier was convicted of manslaughter on Wednesday in the deadly shooting of a badly wounded Palestinian attacker, capping a nine-month saga that has deeply divided the country.

The verdict, which marks an extremely rare case of an Israeli military court convicting a soldier for lethal action taken in the field, threatened to deepen the rift. Military commanders have condemned the soldier’s conduct while much of the public, along with leading members of the nationalist ruling coalition, have rallied behind him.

With Sgt. Elor Azaria’s sentencing believed to be weeks away, the country now faces a heated debate over whether he deserves clemency. Within minutes of the verdict, leading politicians were already calling for him to be pardoned. Under Israeli law, the country’s largely ceremonial president has the authority to issue a pardon.

Get Breaking News Delivered to Your Inbox

Hours after the verdict, Prime Minister Benjamin Netanyahu called for Azaria to be pardoned, plunging into the raging political debate that has divided the country and putting himself at odds with the military. On his Facebook page, Netanyahu wrote: “I support granting Elor Azaria a pardon.” He also urged the public to support the army and its commanders.

Azaria, an army medic, was caught on video in March fatally shooting the wounded Palestinian who had stabbed a soldier in the West Bank city of Hebron. The Palestinian, Abdel Fattah al-Sharif, was lying on the ground and already unarmed when Azaria shot him in the head.

In delivering the verdict, which lasted nearly three hours, Col. Maya Heller, head of a three-judge panel, rejected Azaria’s defense in painstaking detail.

She said there was no evidence to support his contradictory claims that the attacker was already dead or that he posed any threat at the time, telling him he “couldn’t have both sides of the stick.” She called his testimony “unreliable” and said he “needlessly” shot the assailant.

“We found there was no room to accept his arguments,” she said. “His motive for shooting was that he felt the terrorist deserved to die.”

Azaria faces a maximum penalty of 20 years behind bars, though he is not expected to receive that much time. The military said he would be sentenced on Jan. 15. The defense team said it would appeal.

The 20-year-old Azaria entered the court smiling and appearing confident, and he was embraced by a few dozen relatives and friends. But as the verdict was delivered, he stared gloomily ahead, and tensions quickly boiled over in the cramped, crowded courtroom.

Members of Azaria’s family clapped sarcastically as the decision was delivered, some screaming “Our hero!” A female relative was kicked out of the courtroom for screaming at the judges, and a second woman stormed out, shouting, “Disgusting leftists.”

After the judges walked out, Azaria’s mother, Oshra, screamed, “You should be ashamed of yourselves.” Azaria tried to comfort her and calm her as she wailed. Another family member whipped his jacket at a female reporter, missing his target and instead hitting another relative.

Hundreds of the soldier’s supporters, many of them young religious men wearing skullcaps, gathered outside the military court in Tel Aviv ahead of the verdict. The crowd, holding large Israeli flags and banners, periodically scuffled with police.

Right-wing supporters of Israeli soldier Sgt. Elor Azaria scuffle with police outside the Israeli military court in Tel Aviv, Israel, Jan. 4, 2017. AP

Some demonstrators chanted veiled death threats against the Israeli army’s chief, Lt. Gen. Gadi Eizenkot, insinuating he would face the same fate of slain Israeli Prime Minister Yitzhak Rabin, assassinated 20 years ago by an ultranationalist Israeli.

“Gadi, Gadi, watch out. Rabin is looking for a friend,” the demonstrators chanted. The crowd was quickly dispersed without any further violence.

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

Azaria’s defenders said he shot the assailant in self-defense and accused the army of abandoning a soldier on the battlefield, and hard-line politicians have said he should be either cleared or released with a light penalty. But his detractors, including senior military commanders, have said his actions violated the army’s code of ethics and procedures.

The uproar has put the army, the country’s most respected institution, in a delicate position. Military service is compulsory for Israel’s Jewish majority, and there is widespread sympathy for soldiers, since virtually every family has a member who is serving or has served in the past.

Netanyahu, who initially defended the military’s handling of the case, later softened his position and called Azaria’s parents to console them.

The dispute helped fuel the resignation of Defense Minister Moshe Yaalon, who sided with the military, earlier this year. His successor, Avigdor Lieberman, visited Azaria in court. Education Minister Naftali Bennett, leader of the pro-settler Jewish Home Party, has also sided with Azaria and led the chorus calling for his “immediate” pardon on Wednesday.

Lieberman, who heads a hard-line nationalist party, said he disagreed with the “difficult” verdict but urged the public to respect the court’s decision. He said the defense establishment would do “everything it can” to help Azaria and his family.

“We must keep the army outside every political argument ... and keep it in the widest consensus in Israeli society,” he said.

Miri Regev, a popular Cabinet minister from Netanyahu’s Likud Party and a former military spokeswoman, and Shelly Yacimovich, a leading opposition lawmaker, also called for him to be released.

President Reuven Rivlin’s office said a pardon request would be weighed only “following a conclusive judicial ruling.” With Azaria still facing sentencing and an appeals process, that means the matter may not come before the president for some time.

The statement gave no indication whether Rivlin would support a pardon, saying only that he would consider a request “in accordance with standard practices and after recommendations from the relevant authorities.”

Israeli rights groups have accused the army of failing to prosecute soldiers who commit unnecessary violence against Palestinians, and trying a soldier for a crime as serious as manslaughter is virtually unheard of. According to the army, the only manslaughter conviction “in recent years” came in 2004 over the fatal shooting of a pro-Palestinian British activist.

Gilad Grossman of Yesh Din, a rights group that monitors the Israeli military justice system, said the video of Azaria shooting the Palestinian gave the military no choice but to prosecute.

Sharon Gal, a spokesman for the Azaria family, accused the court of siding with human rights groups over a soldier on a battlefield.

“It was like the court was detached from the fact that this was the area of an attack. I felt that the court picked up the knife from the ground and stabbed it in the back of all the soldiers,” he said.

Lt. Col. Nadav Weissman, a military prosecutor, said this was “not a happy day.”

“We would have preferred that this didn’t happen. But the deed was done, and the offense was severe,” he said.

In Hebron, the slain Palestinian attacker’s father welcomed the decision.

“I feel good. It is fair. This is an achievement of the court that it condemned the soldier,” said Yousri al-Sharif.

Al-Sharif gathered with his family in his home to watch the verdict being read live on Israeli television.

“I was exhausted and tense,” he said. “I smoked two packs of cigarettes while watching the verdict.”