Three soldiers on break and a civilian escaped potential lynching when they entered area near an Arab village in northern Samaria earlier.
As the four neared the village of Qusra, they were confronted by local Arab villagers, municipality head Abdul Azeem al-Wadi told AFP.
The villagers attacked the four Israelis, pelting their car with rocks. The Israelis responded by firing in the air.
The villagers surrounded them but Palestinian security forces stepped in to detain the four for their own safety, al-Wadi said.
"Israeli officials have been informed and will come and take them."
A Palestinian security source said the four were later moved to the outskirts of the village, from where Israeli forces took them to safety.
The Israeli army said it was looking into the incident.
AFP contributed to this report.