The group of some 30 settlers threw stones at the IDF patrol and slashed the tires on their vehicle during the 3am incident close to the settlement of Yitzhar in the northern West Bank.
According to the IDF Spokesperson's Unit, the soldiers from the Golani Brigade responded with riot dispersal measures and fired into the air in accordance with the military's rules for opening fire.
"The IDF strongly condemns physical and verbal violence against its servicemen and views such incidents in a very harsh light," the army said.
The incident comes shortly after a resident of Yitzhar was arrested on suspicion of attacking the Golani Brigade patrol commander, Lt. Col. Ayub Kayuf.
According to the IDF, several settlers on Saturday night blocked the vehicle in which the officer was travelling, with one opening the vehicle's door and threatening to seize it.
Kayuf repelled the settlers and filed a complaint with the police.
Two days earlier, Golani military police arrested a youth from Yitzhar on suspicion of setting a fire in the valley between the hills of the settlement and the nearby Palestinian town of Huwara.
The area has long been the site of tensions between the residents of the Palestinian town and the settlers of Yitzhar, with Israeli troops often caught in the middle.
The head of Samaria Regional Council Yossi Dagan and IDF officials were trying to calm the situation on the ground on Sunday.
Dagan met with the soldiers who came under attack and told them that of the local residents' anger over the incident.
"All the residents of Samaria and Yitzhar are disgusted at the harm to our dear soldiers," he said.
"The handful who did this – youths who mostly came from outside the settlements - and will use all our tools at disposal to oust them from here. Yitzhar loves the IDF soldiers along with all the residents of Samaria."