Ahed Tamimi, a 17-year-old Palestinian who was filmed slapping and kicking two Israeli soldiers outside her home, has been released from jail after serving an eight-month sentence.

On Sunday morning, she arrived back to her home village alongside her mother, Nariman, who was also imprisoned and had livestreamed the incident on 15 December on Facebook.

Under a deal accepted by the Israeli military court, Ahed had pleaded guilty to four charges, including assault, incitement and two counts of obstructing soldiers. The trial was held behind closed doors.

Supporters say Ahed Tamimi’s case exemplifies the brutality resulting from 50 years of occupation. The event took place shortly after she heard that Israeli troops had severely wounded her 15-year-old cousin, whom they shot in the head with a rubber bullet during a stone-throwing clash.

Her case has also focused attention on the arrest and detention of young Palestinians by Israel. Local human rights groups say more than 300 minors are currently being held.

Saleh Higazi, head of Amnesty International’s Jerusalem office, said Ahed had served an “unjust sentence based on the ridiculous premise that she posed a threat to armed and heavily protected soldiers. This is a huge relief for Ahed Tamimi’s loved ones, but their joy will be tempered by the injustice of her imprisonment and the grim knowledge that many more Palestinian children still languish in Israeli jails, many despite not having committed any recognisable crime.”

In Nabi Saleh, a village known for years of anti-occupation protests that often descend into stone throwing and the deployment of teargas, Palestinian flags had been set up on the roof of the Tamimi family home. The mother and daughter were greeted with cheers as they entered on Sunday.

“The resistance continues until the occupation is removed,” Ahed said. “All the female prisoners are steadfast. I salute everyone who supported me and my case.”

Ahed visited the grave of former Palestinian leader Yasser Arafat, where she laid a wreath, kissed the headstone twice at the request of photographers, and recited a prayer from the Qur’an.

She was then taken with her family to a meeting with the Palestinian president, Mahmoud Abbas, at his headquarters in Ramallah.

Her father, Bassem, said other prisons had helped his daughter complete her high school exams in jail, and she had received scholarship offers for universities abroad.

In Israel, many have praised the restraint shown by the two soldiers and accused the Tamimis of setting up filmed provocations. Israel’s culture minister, Miri Regev, has referred to the teenager as a “terrorist”.

Israel captured and occupied the West Bank, Gaza and East Jerusalem in the 1967 war with Jordan, Egypt and Syria. It disengaged from Gaza in 2005, but through military rule it maintains control over most of the West Bank, where the Palestinians have limited autonomy.

The Associated Press contributed to this report