A Palestinian broke into a home in a Jewish settlement in the occupied West Bank on Friday and stabbed four Israelis, killing three of them, the Israeli army said.
The attack in Neve Tsuf, north of Ramallah, came after a day of clashes between Palestinian protesters and Israeli forces over new security measures at a highly sensitive Jerusalem holy site.
Three Palestinians were killed and hundreds wounded in the clashes in Jerusalem and the West Bank.
The attacker at the settlement was a 19-year-old Palestinian supporter of Hamas, the Islamist movement that runs the Gaza Strip, according to an Israeli military official.
He jumped the fence of the settlement before breaking into the house, where he stabbed the Israelis during a Sabbath dinner, the army official said.
According to the official, a grandfather and two of his children died, while the grandmother was wounded. The official provided no further details on the victims.
The Palestinian was stopped by a neighbour, an off-duty Israeli soldier, who shot him, the official said. The Palestinian was being treated in hospital.
The Israeli army said the Palestinian had spoken of the Jerusalem holy site and of dying as a martyr in a Facebook post.
The clashes earlier in the day came after Israeli ministers decided not to order the removal of metal detectors erected at entrances to the Haram al-Sharif compound, known to Jews as the Temple Mount, following an attack nearby a week ago that killed two policemen.
In anticipation of protests on Friday, Israeli police barred men under 50 from entering the Old City in annexed east Jerusalem for prayers, while all women were allowed in.
The holy compound includes the Al-Aqsa mosque and the Dome of the Rock. It is considered the third-holiest site in Islam and the most sacred for Jews.