A suspected Palestinian militant stabbed and wounded an Israeli soldier, snatched his gun and was then shot dead by special forces as a surge of violence prompted Israel's prime minister to cancel a visit to Germany.

Hours earlier, police said an 18-year-old Palestinian woman stabbed an Israeli near a contested shrine in Jerusalem, and was then shot and wounded by the injured man, the third knife attack in the city in less than a week.

Both Israeli and Palestinian leaders have sought to calm a rise in street violence that has been exacerbated by confrontations around Jerusalem's al Aqsa mosque complex, Islam's third holiest shrine which Jews also revere as the vestige of their two ancient temples.

Four Israelis have been killed in stabbings in Jerusalem and a drive-by shooting in the occupied West Bank since Thursday, and two Palestinians have been shot dead and scores injured in clashes with security services, triggering fears of an escalation.

In the latest attack, an Arab stabbed a soldier on a bus in the southern Israeli town of Kiryat Gat, grabbed his gun and ran into a residential building. He was shot dead by police special forces.

The 18-year-old Palestinian woman stabbed an Israeli man near the Western Wall, a Jewish prayer site in Jerusalem's walled Old City abutting the al Aqsa mosque complex. The injured Israeli drew a gun and shot the woman, seriously wounding her, police said.

Hoping to head off the violence and potential knock-on attacks by ultra-nationalist Israelis, Prime Minister Benjamin Netanyahu has beefed up the military presence in Jerusalem and the West Bank.

Though at diplomatic loggerheads with Mr Netanyahu over peace talks that stalled in April 2014, the US-backed Palestinian president, Mahmoud Abbas, has also said he seeks no escalation.

Mr Netanyahu was due to visit Germany, Israel's most important European ally, on Thursday with members of his cabinet. But aides to Netanyahu he had cancelled the trip because of the precarious security situation.