A Palestinian teenager has left prison after an eight-month sentence for slapping two Israeli soldiers, an episode captured on video which later went viral.

Ahed Tamimi, 17, and her mother, who was also jailed over the incident, were driven by Israeli authorities from a prison inside Israel to a checkpoint leading to the occupied West Bank, where they live.

Both were sentenced to eight months in an Israeli military court following a plea deal over the December incident which the Tamimi family said took place in their yard in Nabi Saleh in the West Bank.

Video of it went viral, leading Palestinians to view her as a hero standing up to Israel's occupation.

Her now-familiar image has been painted on Israel's separation wall cutting off the West Bank, Palestinian president Mahmud Abbas has praised her and social media has been flooded with support.

But for Israelis, Tamimi is being used by her activist family as a pawn in staged provocations.

They point to a series of previous such incidents involving her, with older pictures of her confronting soldiers widely shared online.

Many Israelis also praised the restraint of the soldiers, who remained calm throughout, though others said her actions merited a tougher response.

Tamimi was arrested in the early hours of 19 December, four days after the incident. She was 16 at the time.

Her mother Nariman was also arrested, as was her cousin Nour.