JERUSALEM — An Israeli military court charged a soldier with manslaughter Monday after he was allegedly caught on video fatally shooting a wounded Palestinian attacker.
The decision set the stage for a rare criminal trial against an active serviceman in a case that has bitterly divided the nation.
While Israeli defense officials have criticized the soldier’s conduct, large segments of the public have rallied behind him and accused the government of abandoning him at a time of heightened conflict with the Palestinians.
The soldier, identified Monday as Sergeant Elor Azaria, a medic, was charged in a shooting last month in Hebron, a West Bank city that has been a focal point of a seven-month wave of Israeli-Palestinian fighting.
At the time of the incident, the military said two Palestinians had been shot and killed while carrying out a stabbing attack that wounded an Israeli soldier. But a video released by the Israeli human rights group B’Tselem showed one of the attackers still alive after the initial shooting.
The video, taken by a B’Tselem volunteer, shows Azaria calmly raising his rifle, cocking the weapon and firing at the assailant’s head. An autopsy determined that the shot to the head cause his death.
In a separate development Monday, a bus exploded in Jerusalem, wounding at least 21 people in what police said was a terror attack, raising fears of a return to the Palestinian suicide bombings that ravaged Israeli cities a decade ago.
‘‘There is no doubt that this was a terror attack,’’ Jerusalem police commissioner Yoram Halevy said. He said it was too early to know the identity of the attacker or if it was a suicide bombing.
Police spokesman Micky Rosenfeld said 21 people were wounded in the attack, two seriously, seven moderately, and the rest lightly. Another bus and a car nearby were also damaged by the explosion.
It was not clear how many people were on the bus at the time it exploded. Police said the blast was caused by an explosive device detonated at the back of the bus. Bus driver Moshe Levy told reporters he checked his bus for bombs twice before he started his journey.
Israeli Prime Minister Benjamin Netanyahu vowed retaliation against those who planned and executed the attack. “We will settle the score with these terrorists,’’ he said.
In its indictment of Azaria, the military prosecution said the soldier ‘‘acted in contrast to the rules of opening fire and without any operational justification.’’ It was not immediately clear what sentence the soldier could face if convicted.
Prosecutors said the Palestinian, Abdel-Fattah al-Sharif, ‘‘did not present a clear and present threat’’ and that ‘‘the defendant caused the death of the terrorist al-Sharif illegally.’’ He was also charged with inappropriate military conduct.
His attorney, Ilan Katz, said Azaria acted as expected from a combat soldier and would seek a full acquittal.
Since September, Palestinian attackers have killed 28 Israelis and two Americans in stabbings, car rammings, and shootings. At least 189 Palestinians have been killed, most of them said by Israel to be attackers, with the rest killed in clashes with Israeli security forces.
The Palestinians have repeatedly accused Israel of using excessive force against attackers who have already been halted or injured, or in some cases, of killing innocent civilians.