EL-BIREH, West Bank (Reuters) - Reuters photographer Mohamad Torokman found himself staring down the barrel of a gun when he captured the moment an undercover Israeli military group shut down a Palestinian protest, in a rarely witnessed infiltration technique.

Photo essay: http://reut.rs/2Ap07MI

Torokman was on assignment near the Jewish settlement of Beit El, close to the Palestinian hub city of Ramallah, on Wednesday where protests were underway against U.S. President Donald Trump's decision to recognize Jerusalem as the capital of Israel.

Hundreds turned out, as they had done for days following Trump's announcement. Some burnt tires, others hurled stones at Israeli troops, all oblivious to the surprise military move that awaited them.

"The undercover personnel were posing as Palestinian protesters and were standing behind the stone-throwers," said Torokman, who has covered clashes in the region for nearly two decades.

"All of a sudden, they started to fire their pistols into the air and throw sound grenades at the same time."

The din of the grenades and guns caused panic among the protesters.

Torokman saw eight Israeli personnel, wearing masks fashioned from Arab headdresses or the Palestinian flag, leap into action and detain protesters.

He kept photographing, thereby capturing the moment as an undercover agent grappling with a protester swung round, briefly pointing his gun directly at Torokman.

"He shouted at me and told me to go away," said Torokman, who described the atmosphere as terrifying.

"I heeded his order for my own safety and I quickly moved away."

The remaining protesters fled as uniformed Israeli troops moved in. Torokman took photographs from a safer location. The incident was over in less than five minutes.

It was the third time Torokman saw at first hand the work of the undercover commandos, known in Hebrew as "Mistaravim" or "in Arab disguise", but this was by far the most scary.

"The level of risk was the highest this time as the personnel were aiming their weapons at me," he said.

(Writing by Patrick Johnston and editing by Hugh Lawson in LONDON)