A Palestinian man was arrested on Sunday while trying to enter a West Bank military court with two pipe bombs, police said.

The suspect, who was stopped by Border Police officers at the entrance to the Samaria Military Court, had a bomb strapped to his body, according to police.

Police confirmed the pipe bomb, which was destroyed by sappers, contained explosive material.

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

Sappers also defused a second pipe bomb, which along with a knife was found in the suspect’s coat.

Police said the entrance to the court had been closed and that the suspect, a 17-year-old resident of the Jenin refugee camp, was taken in for questioning following his arrest.

A police spokesperson praised “the vigilance of the soldiers who prevented an attack.”

The incident came amid ongoing tensions over US President Donald Trump’s recognition of Jerusalem as Israel’s capital earlier this month.

While protests over the weekend were smaller than the previous week, four Palestinians were killed on Friday by Israeli security forces during violent riots in the West Bank and in the Gaza Strip.

In the first incident on Friday, a Palestinian terrorist stabbed an Israeli border police officer near Ramallah, before being fatally shot.

The attacker, who the Palestinian Authority health ministry named as Mohammed Aqal, 29, was shot by other officers after stabbing the border policeman. Aqal was wearing what appeared to be a suicide belt, the army said. Hadashot news later said it did not contain actual explosives.

Jerusalem’s Shaare Zedek Medical Center said Sunday that the condition of the officer, who was moderately wounded in the stabbing, has improved.