A Palestinian teenager arrested after a viral video showed her hitting two Israeli soldiers in the occupied West Bank has reached a plea deal that will see her serve eight months in prison.
The Israeli military court where Ahed Tamimi was being tried accepted the deal between her and prosecutors late Wednesday, in a case that has drawn international attention.
Ahed, 16 at the time of the incident in December, has been hailed as a hero by Palestinians who see her as bravely standing up to Israel's occupation of the West Bank.
Israelis accuse her family of using her, now 17, as a pawn in staged provocations.
Ahed told reporters before the court accepted the agreement that "there is no justice under occupation and this is an illegitimate court."
Her sentence in the agreement includes time served and a fine of 5,000 shekels (Dh5,250), said her lawyer Gaby Lasky, meaning she is to be released in the summer.
She accepted to plead guilty to four of the 12 charges against her under the agreement, including assault, incitement and two counts of obstructing soldiers, Lasky said.
The Israeli army said in a statement after the sentence that it "will continue operating in order to preserve the security and public order [in the West Bank] and enforce the law as it pertains to anyone who harms [Israeli] soldiers and incites violence."
Lasky only accepted to present the plea bargain to the military court after it first accepted an agreement with Ahed's mother, Nariman Tamimi.
A plea deal for Nariman will also see her serve eight months in jail including time served, along with a 6,000-shekel fine, she said.
Earlier in the day in the same case, Ahed's cousin Nour Tamimi had her plea deal approved that saw her go free, the lawyer said.
The 20-year-old was sentenced to 16 days – already served after her arrest – and fined 2,000 shekels for assault of a soldier.
Both Ahed and her mother were ordered held in custody throughout their trials, while Nour had been freed on bail.
At one point in the court on Wednesday, in a sign of the passions involved in the case, an activist slapped one of the prosecutors in the head as he was leaving and was later arrested, an AFP journalist reported.
Ahed's trial began on February 13 behind closed doors at the Israeli military court in the West Bank. Lasky appealed to have the trial opened, but was rejected.
The court ordered the trial closed because Ahed was being tried as a minor, as is usual in such cases.
"When they decided to keep her trial behind closed doors, we knew that we were not going to get a fair trial," Lasky told AFP in describing her reasons for seeking a plea bargain.
The UN Office of the High Commissioner for Human Rights has criticised Israeli authorities' actions in the case, while the European Union has expressed concern over Israel's detention of minors such as Ahed.
"Ahed will be home in a few months, but Israel is putting this child behind bars for eight months for calling for protests and slapping a soldier, after threatening her with years in jail," Sarah Leah Whitson, executive director of the Middle East division of Human Rights Watch, said in a statement.
Her family says the December 15 incident that led to the arrests occurred in the yard of their home in Nabi Saleh, near Ramallah in the West Bank.
The Israeli military said the soldiers were in the area to prevent Palestinians from throwing stones at Israeli motorists.
The video shows the cousins approaching two soldiers and telling them to leave before shoving, kicking and slapping them.
Ahed is the more aggressive of the two in the video.
The heavily armed soldiers do not respond to what appears to be an attempt to provoke rather than seriously harm them.
They then move backwards after Nariman becomes involved.
The scuffle took place amid clashes and protests against US President Donald Trump's controversial recognition of Jerusalem as Israel's capital.