A terrorist attack was foiled at an Israeli farm in Samaria Friday morning, just hours after a terrorist opened fire on civilians on a crowded Tel Aviv street Thursday night and an attempted bombing in Beitar Illit.

The Palestinian Arab terrorist, armed with a knife and several pipe bombs, infiltrated into the farm, located near Maale Shomron, and began shouting “Allahu Akbar.”

The owner of the farm spotted the terrorist brandishing a knife and opened fire, fatally wounding the terrorist.

After he was shot dead, the terrorist was found to be carrying multiple pipe bombs.

Also on Friday morning, the IDF ended the state of emergency in Beitar Illit, telling residents that it is once again safe to leave their homes.

The army conducted searches overnight, after a bomb was found on a bus in the predominantly haredi city.

Earlier on Thursday, a 23-year-old terrorist from the village of Ni’lin shot and wounded three Israeli men in their 20s in Tel Aviv, before being shot and killed by Israeli security personnel.