Two Israeli soldiers came under attack, getting pelted with rocks and beaten by a mob, after they accidentally drove their military car into the Palestinian city of Jenin in the northern West Bank on Monday, the army said.

In the attack, one of the soldiers’ guns was stolen by the rioting Palestinians, according to the Israel Defense Forces.

The army said forces were searching the area for the weapon.

Get The Times of Israel's Daily Edition by email and never miss our top stories Free Sign Up

When the two soldiers, a man and a woman, drove into the city on Monday afternoon, local residents began attacking the car with rocks and chairs, breaking the windows and bloodying the soldiers.

Before the riot began, the female soldier could be seen holding an M-16 assault rifle, without a magazine, across her lap. It was not immediately clear if the male soldier had a gun as well.

Videos from the scene showed swarms of people surrounding the vehicle and clawing at the soldiers inside it, including one person who appeared to try grabbing the female soldier by her hair.

She was taken to a nearby Israeli hospital for treatment, the army said.

Palestinian security forces could be seen in the videos protecting the Israeli soldiers during the riot. They also helped them leave the area.

Deputy Governor of Jenin Kamal Abu al-Rub said the IDF vehicle was attacked by Palestinians for “nationalist motives.”

He confirmed PA policemen rushed to the scene to secure the safe exit of the vehicle from the city.

The IDF said the car was brought out of the city through coordination with the Civil Administration, a Defense Ministry unit that acts as a liaison between the military and Palestinians.

Markings on their vehicle indicated that they were noncombat soldiers from a support unit.

An IDF spokesperson said it was not immediately clear how they accidentally drove into the Palestinian city. In the past, this has happened because soldiers relied on navigation applications.

“The event is being investigated,” the army said.

Khaled Abu Toameh contributed to this report.