The Israeli military court where Ahed Tamimi was being tried accepted the deal between her and prosecutors in the case that has drawn international attention.
Tamimi, 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 Tamimi, now 17, as a pawn in staged provocations.
She told reporters on Wednesday before the court accepted the agreement that "there is no justice under occupation and this is an illegitimate court."
Tamimi's sentence in the agreement includes time served and a fine of 5,000 shekels ($1,430, 1,166 euros), 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 Tamimi's mother, Nariman Tamimi.
A plea deal for Nariman Tamimi 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, Tamimi'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 Tamimi and her mother were ordered held in custody throughout their trials, while Nour Tamimi 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.
Closed-door trial
Tamimi'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, including Ahed Tamimi.
"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.
Tamimi's 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 Tamimi 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 Tamimi becomes involved.
The scuffle took place amid clashes and protests against US President Donald Trump's controversial recognition of Jerusalem as Israel's capital.
Relatives say a member of the Tamimi family was wounded in the head by a rubber bullet fired during those protests.
Ahed Tamimi, who comes from a family of prominent activists, has been involved in a series of previous incidents, with older pictures of her confronting soldiers widely published.
Palestinians have flooded social media with praise and support.