Police said lax security was partly to blame for a terror attack in a West Bank supermarket Thursday, and appeared intent to make an example of the store in order to pressure other businesses to increase their vigilance.

Investigators found that the two Palestinian teens who stabbed off-duty Israeli soldier Tuvia Yanai Weissman, 21, to death and seriously wounded another man earlier in the day were able to bring knives into the store without being inspected by the security guard at the entrance.

Officials said the store — a branch of the Rami Levy chain — would be shuttered until serious security flaws were remedied. The chain may also face a forced closure of all its West Bank stores unless security is boosted across the board.

A senior police official told Channel 2 news the move was mainly a deterrent to other businesses.

Israeli supermarket mogul Rami Levy (photo credit: Yossi Zamir/Flash90)

Israeli supermarket mogul Rami Levy (Yossi Zamir/Flash90)

“Security guards are not posted at the entrance for decoration,” the unnamed official was quoted as saying. “Their job is just that — to prevent an attack.”

The attack took place in a supermarket in the Sha’ar Binyamin industrial zone, located southeast of Ramallah in the West Bank. The supermarket has been the site of several Palestinian attacks in recent months.

Weissman was hospitalized in Jerusalem’s Shaare Zedek Medical Center in critical condition, where doctors pronounced him dead after fighting to save his life. The second victim, 35, was hospitalized at the Hadassah Hospital in Jerusalem’s Mount Scopus neighborhood in serious condition.

President Reuven Rivlin sought to “comfort” the families of the victims on Thursday evening.

President Reuven Rivlin speaks at the President's residence in Jerusalem, on February 4, 2016 (Hadas Parush/Flash90)

President Reuven Rivlin speaks at the President’s residence in Jerusalem, on February 4, 2016 (Hadas Parush/Flash90)

“A man returns from his day at work, stops to buy groceries for Shabbat, and is taken away forever by murderous villains,” he said in a statement. “We will stand strong and respond firmly to restore calm and normality to the lives of our citizens everywhere. We will defeat terrorism.”

Transportation Minister Yisrael Katz used the opportunity to lambast IDF Chief of Staff Lt. Gen Gadi Eisenkot over his comments Wednesday to the effect that soldiers should refrain from emptying their magazines at child assailants who do not necessarily represent a mortal threat.

“I hope the statements made by the chief of staff, whom I value and hold in high esteem, against automatic fire on minors, were not misconstrued, causing hesitation and endangering lives,” he said.

“The limitations and codes are clear, but terrorists mustn’t be kept alive while endangering Jewish lives.”

The two Palestinian stabbers were shot by an armed civilian after stabbing the two victims, and were seriously wounded. They were 14-year-old boys from Beitunia near Ramallah, Palestinian reports said.

Channel 10 TV reported that the attackers walked around the supermarket for about 20 minutes scoping out victims before the stabbing. The station spoke with an unidentified civilian who said he opened fire at the attackers. The civilian, who was carrying a gun, said he was inside a prayer area near the supermarket and soon after services began, he heard screaming, went outside and shot at the attackers.

Rescue personnel at the scene of a stabbing attack north of Jerusalem on Thursday, February 18, 2016 (United Hatzalah)

Rescue personnel at the scene of a stabbing attack north of Jerusalem on Thursday, February 18, 2016 (United Hatzalah)

The supermarket is located in an industrial zone frequented by Israeli settlers as well as Palestinians.

Since October 1, some 30 Israelis have been killed by Palestinians in knife, gun and car-ramming attacks. At the same time, more than 160 Palestinians have been killed, some 115 of them while carrying out attacks, and others during clashes and demonstrations.

Judah Ari Gross and news agencies contributed to this report.