Bethlehem, occupied West Bank - Imprisoned Palestinian teen activist Ahed Tamimi has reached a plea bargain with Israeli army prosecutors that will see her serve eight months in jail.

The 17-year-old was arrested in December 2017 after a video of her slapping and hitting two Israeli soldiers outside of her house in the village of Nabi Saleh went viral.

The sentence, announced during a closed-door hearing on Wednesday at Israel's Ofer military court near Ramallah, brought to an end a case that attracted worldwide attention.

Tamimi accepted the deal in exchange for pleading guilty to four out of the 12 charges initially brought against her, according to Gaby Lasky, the lawyer of the teen.

The other eight charges against Tamimi, including those referencing instances of stone throwing and "incitement to terror and stabbings", were dropped by the prosecution, Lasky told Al Jazeera.

"There is no justice under the occupation and this court is illegal," the teen said, addressing the courtroom after the plea deal was presented to the judge, according to her father, Bassem Tamimi.

Tamimi pleaded guilty to "attacking" two Israeli army officials and to "two additional criminal acts" where she "disrupted" an Israeli soldier and "carried out incitement", according to an Israeli army statement.

The three months Tamimi has already served in prison will be counted into her overall sentence, Lasky said. She will also be fined $1,500.

Last month, the judge decided that the teen's trial would proceed behind closed doors. On Monday, Israel's military appeals court rejected Tamimi's request to hold her legal proceedings in an open court.

Following that decision, "we understood that Ahed was not going to receive a fair trial", said Lasky. "A plea bargain is the best option that Palestinians can get in the military courts."

Convictions against the Tamimi women

Tamimi was arrested during an overnight army raid after the video of her confrontation with the Israeli soldiers was widely shared on social media. Her mother, Nariman, was arrested soon after for allegedly live streaming the incident on Facebook.

Shortly before the video was filmed, the teen had been informed that Israeli forces had shot her 15-year-old cousin, Mohammad, point-blank in the face with a rubber bullet.

In January, Ahed and Nariman were both indicted on various charges, including "aggravated assault" and "incitement".

Lasky said Nariman had also accepted a plea bargain. Like her daughter, she was also sentenced to eight months in prison, including time already served. According to the army statement, Nariman was convicted of "causing incitement" and "disrupting and attacking" Israeli soldiers.

Nariman will be fined $1,700.

Both are expected to be released in July.

"This is the way that the occupation is punishing us," Bassem said following the hearing. "All of the occupation's decisions are illegal and unjustified, because the occupation itself is illegal."

Meanwhile, Nour, Ahed's 20-year-old cousin who also appeared in the controversial video, was convicted of "attacking" an Israeli soldier and sentenced to time already served and a fine of $576, according to the army statement.

'She cannot get a fair trial'

Sahar Francis, director of Palestinian prisoners' rights group Addameer, told Al Jazeera that "most cases" in Israel's military courts result in a plea bargain.

"They [Palestinians] don't trust the system. All the confessions are taken following torture, ill-treatment and coercion," she said.

If a Palestinian was to proceed with a trial, it would be based on "confessions" obtained through abuse and coercion during initial interrogations, Francis said.

Meanwhile, Palestinians face an almost 100 percent conviction rate in Israel's military courts, leaving Palestinians with little hope for a fair trial.

According to Defense for Children International-Palestine (DCIP), out of 297 cases that were closed by the group’s lawyers between 2012 and 2015, 295 resulted in a plea bargain.

"These military courts are incapable of offering a fair trial under a prolonged 50-year [military] occupation,” said Francis.

First visit

Meanwhile, prior to Tamimi's hearing on Wednesday, 38 prominent legal experts from various countries, including South Africa, Canada, the Netherlands and the United States, submitted a letter to Nadav Padan, Israel's army commander, calling for the teen's release.

The lawyers noted that her case exemplifies Israel's routine violations of the rights of Palestinian children and Israel's "separate and unequal system of military detention".

Palestinians are tried in Israel's military courts and face harsher sentences than Israelis who have committed the same crimes, but are tried in civil courts.

This two-tiered legal system "segregates based on race and nationality in the occupied territories," the statement said.

Meanwhile, Bassem on Monday was able to visit his daughter and wife in Israel's HaSharon prison for the first time since they were arrested three months ago.

"I couldn’t sleep for days before the visit. For months, I have been constantly thinking about how they are doing and how I could speak with them," said Bassem, who has also been arrested numerous times by Israeli forces.

"It was difficult for me when I saw them. I felt a variety of emotions. I was happy and sad at the same time," he said.