JERUSALEM — Palestinian assailants carried out a series of stabbings across Israel on Wednesday, jolting an anxious country unnerved by weeks of unrest as clashes between Israeli forces and Palestinian demonstrators raged across the West Bank.

The violence forced Prime Minister Benjamin Netanyahu to call off a high-profile visit to Germany and prompted him to tell the nation to be on “alert” for further trouble. And in another sign of the tensions, Jerusalem’s mayor, Nir Barkat, was seen carrying an assault rifle while visiting an Arab neighborhood.

The unrest began three weeks ago and has spread from the confines of a sensitive Jerusalem holy site to spots across Israel and the West Bank. In Wednesday’s violence, stabbings occurred outside a crowded mall in central Israel, in a southern Israeli town and in the Old City of Jerusalem.

Israeli forces shot two of the attackers, killing one, while a third was arrested. No Israelis were seriously hurt. Another Palestinian was wounded when he was shot by police after he attempted to run over an officer at a West Bank checkpoint, police said.

Netanyahu has threatened a tough response to the violence, and Israel has beefed up security in Jerusalem and the West Bank. It also briefly barred non-resident Palestinians from entering the Old City, home to sensitive holy sites. That ban was lifted shortly before Wednesday’s stabbing.

In all, four Israelis have been killed in stabbings and a roadside shooting in recent days, while five Palestinians, including three attackers, have been killed.

With the attacks spilling into the Israeli heartland, Netanyahu warned Israelis to be on guard.

“Civilians are at the forefront of the war against terrorism and must also be on maximum alert,” Netanyahu said, after a meeting with top police officials.