The attacker who used an assault rifle to methodically gun down victims from a motorcycle in a central Israeli city was a Palestinian, Israeli police said.
The shooter, identified as Diaa Hamarsheh, 27, from the occupied West Bank village of Yabad, was killed by police late on Tuesday.
The military raided the man’s home early on Wednesday and arrested several of his relatives as part of its investigation, Israeli media said.
The incident was the third attack of its kind ahead of the Muslim holy month of Ramadan.
The previous two, carried out by Palestinian citizens of Israel inspired by the so-called Islamic State (Isis), sparked fears of further violence.
Israel “stands before a wave of murderous Arab terrorism”, declared Prime Minister Naftali Bennett.
He pledged to combat it “with perseverance, stubbornness and an iron fist”.
He held an emergency meeting of top security officials and planned a meeting of his Security Cabinet on Wednesday.
Israeli authorities have not yet determined whether the attacks were organised or if the attackers acted as lone wolves.
The Israeli military announced it would be deploying additional troops to the West Bank, and the police chief raised the national readiness level to its highest.
Amateur video footage aired on Israeli television appeared to show the gunman in a black shirt stopping a moving vehicle and shooting the driver.
Another showed him chasing a cyclist, with the gun appearing to jam as he tried to fire.
Tuesday’s shootings occurred at two locations in Bnei Brak, an ultra-Orthodox city just east of Tel Aviv.
Police said a preliminary investigation found the gunman was armed with an assault rifle and opened fire on passers-by before he was shot by officers at the scene.
Five people were killed, the Magen David Adom paramedic service confirmed.
One of the victims was a police officer who arrived at the scene and challenged the shooter, police said.
Two other victims were foreign citizens from Ukraine, the force added.
The security forces “will work with all means to return security to Israeli streets and the feeling of security to civilians”, Israel defence minister Benny Gantz wrote on Twitter.
In the Israeli-occupied West Bank, Palestinian President Mahmoud Abbas condemned the attack, saying the killing of Israeli or Palestinian civilians “only leads to further deterioration of the situation and instability, which we all strive to achieve, especially as we are approaching the holy month of Ramadan and Christian and Jewish holidays”.
He said the violence “confirms that permanent, comprehensive and just peace is the shortest way to provide security and stability for the Palestinian and Israeli peoples”.
No Palestinian groups immediately claimed responsibility for the attack. The Islamist militant group Hamas praised the “heroic operation” but stopped short of claiming responsibility.
Israel in recent weeks has been taking steps aimed at calming tensions and avoiding a repeat of last year, when clashes between Israeli police and Palestinian demonstrators in Jerusalem boiled over into an 11-day war between Israel and Hamas.
But the new wave of violence is greatly complicating those efforts.
On Sunday, a pair of gunmen killed two young police officers during a shooting in the central city of Hadera, and last week, a lone assailant killed four people in a car ramming and stabbing attack in the southern city of Beersheba.
Earlier on Tuesday, Israeli security services raided the homes of at least 12 Arab citizens and arrested two suspected of having ties to Isis in a crackdown sparked by recent deadly attacks.
Hours before the raid, Mr Bennett said the recent assaults inside Israel marked a “new situation” that required stepped-up security measures.
Officials said 31 homes and sites were searched overnight in northern Israel, an area that was home to the gunmen who carried out the Hadera attack.
Isis has claimed responsibility for the two previous attacks.
All of the attacks have come just ahead of Ramadan, which begins later this week and as Israel hosted a high-profile meeting between the foreign ministers of four Arab nations and the United States.
All four Arab nations — Egypt, Morocco, Bahrain and the United Arab Emirates — along with the United States, condemned the killings.
Ramadan is expected to begin on Saturday.
Deadly attacks by Isis inside Israel, and attacks by Arab citizens of Israel, are rare.
The group operates mainly in Iraq and Syria, where it has recently stepped up attacks against security forces.
It no longer controls any territory but operates through sleeper cells. Isis has claimed attacks against Israeli troops in the past and has branches in Afghanistan and other countries.