Four Palestinians have been shot dead in what Israel claims were thwarted knife attacks as tensions ran high after more than two weeks of unrest.

At least 40 Palestinians and seven Israelis have died in the recent violence, which was in part triggered by Palestinians' anger over what they see as increased Jewish encroachment on Jerusalem's al-Aqsa mosque compound.

There were contradictory accounts of one of the shootings, near a Jewish settlement in the West Bank city of Hebron.

Israel said a Palestinian attempted to stab an Israeli civilian, who was carrying a gun and then shot and killed the attacker.

However, a Palestinian man told Reuters that his daughter, a high school student, witnessed the shooting and said it happened when Jewish settlers attacked an unarmed Palestinian.

Also in Hebron, a Palestinian woman stabbed an Israeli border policewoman, cutting her hand, a police spokesman said.

The policewoman shot the attacker, he said.

In a neighbourhood around East Jerusalem, Israeli border police had stopped to question a 16-year-old Palestinian walking in "a suspicious manner", a police spokesman said.

The teenager reportedly drew a knife and tried to stab the officers, who shot him dead, the spokesman said.

Police said an Israeli border guard killed a Palestinian when he attempted to stab him at the Qalandiya checkpoint between Jerusalem and the West Bank.

The guard shot and wounded his attacker, then killed him after the attacker tried again to stab him as he attempted to take the knife away, spokeswoman Luba Samri said.

The violence has mostly occurred in Jerusalem and the West Bank, but has also erupted along the Gaza-Israel border.

Today, Israel's army defused a rocket it said had been fired by Gaza militants overnight, landing in an open area.

The street violence, some of the worst in years, has been intensified by conflicting witness accounts and amateur video that has been interpreted in different ways.

In some cases, witnesses gave accounts that were later shown by video footage to be false.

Israel says it is keeping the status quo at the holy compound, which is also revered by Jews as the location of two destroyed biblical Jewish temples.

Peace talks collapsed in 2014 over Israeli settlement-building in the occupied West Bank and East Jerusalem, areas Palestinians seek for a state, and after Palestinian President Mahmoud Abbas angered Israel by reaching a unity deal with the Islamist group Hamas in Gaza.

The last major confrontation was the Gaza conflict between Israel and Hamas in 2014, which left large sections of Gaza destroyed.

Around 2,100 Palestinians, most of them civilians, and 73 Israelis, most of them soldiers, were killed.

The United States has stepped up efforts to try to restore calm to the region.

US Secretary of State John Kerry spoke by phone with both Israeli Prime Minister Benjamin Netanyahu and Mr Abbas to discuss ways to end the violence.

Mr Kerry and Mr Netanyahu are due to meet next week in Germany.