In a matter of seconds, the men wearing scarves over their faces and throwing stones along with a group of Palestinians pulled out their guns, opened fire and blew their cover.

“Mustarabiin!” [or mistaarvim in Hebrew] rang out among the crowd of about 100 Palestinians who had been hurling stones at Israeli soldiers for several hours at the Beit El checkpoint outside Ramallah. The term refers to Israeli soldiers dressed like Arabs to carry out military missions.

The incident on Wednesday, captured on video (above) by an AP journalist, and also filmed by AFP, offered a rare glimpse of what appeared to be Israeli troops embedded with a group of Palestinian stone-throwers.

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

The Palestinians regularly accuse Israel of placing Arabic-speaking “infiltrators” among demonstrators in order to make arrests.

The undercover agents on Wednesday grabbed and beat one man while opening fire as stones flew toward them. One of the agents also appeared to shoot the man in the thigh at point-blank range. In all, three people were wounded, including one who was in critical condition after he was shot in the back of the head, according to AFP.

In a Facebook post, IDF Spokesman Peter Lerner published a 17-second video put out by the IDF showing the incident from a different angle and identifying the undercover forces as being from the IDF’s elite “Duvdevan” unit.

A stabbing in Jerusalem.A Stabbing in Kiryat Gat.A Stabbing in Petah Tikva. An attempted lynch in Tekoa. A car rammed into a checkpoint. While the terrorists must think they are on to something. I'll leave you with these 17 seconds, it took our 'Duvdevan', Special Forces unit to arrest three Palestinians that together with a crowd of about 300 were attacking anybody traveling the main road to Jerusalem. Special Forces, a small, select group of men, infiltrated the masses and posed as Palestinians. In the few seconds when they activated their mission, they scared everybody around to disperse. These guys are courageous, daring and are putting themselves at risk for the rest of us. Two words – THANK YOU Posted by Peter Lerner on Wednesday, 7 October 2015

The undercover forces had been there for at least 30 minutes, AFP journalists reported, but were impossible to recognize beforehand. As riots have spread through east Jerusalem and the West Bank, stone-throwers have almost always been masked or wearing traditional Palestinian keffiyeh scarves.

Arriving with backpacks, trainers and jerseys of Barcelona and the French national football teams, they mixed with students who had called for a “day of rage.”

One undercover Israeli even had a green scarf for Islamist terror group Hamas trailing from the pocket of his jeans.

Responding to the call from student guilds, the protesters left from Bir Zeit University under the rallying cry: “Bir Zeit was a stronghold of the intifada (uprising).

“It must lead the movement again.”

Clashes broke out immediately after they arrived at Beit El, which has become the site of daily protests amid the recent wave of unrest.

The undercover troops joined the front line, dozens of meters from soldiers posted there with jeeps and armored vehicles.

At first, they threw stones like the others. Protesters hid behind a rubbish bin that served as a makeshift barricade against rubber bullets fired by Israeli troops along with tear gas and stun grenades.

In an instant, they withdrew from the crowd and pulled out guns, as the protesters realized what was happening. The protesters threw stones at the men, four of whom pointed their weapons and opened fire, according to AFP reporters.

Three others who were unarmed grabbed two wounded youths and are shown in the video beating them. One youth who ran is said to have been hit in the back of the head, according to AFP. The video does not show this part.

Israeli soldiers rushed to the scene and fired in the air. Both the undercovers and the soldiers then grabbed three of the youths and brought them toward jeeps and armored vehicles.

“Be careful — they arrested them. They’re mustarabiin,” one protester said.

Another said “they’re always in the middle of the crowd.”

Israel’s military declined to comment directly on who the soldiers were. Spokesman Arye Shalicar said only that the army is equipped with such units, without confirming whether or not those involved in Wednesday’s incident were among them.

Shalicar confirmed that one of the wounded protesters from Beit El was held by Israel and is in critical condition.