The armed wing of the Palestinian militant group, Hamas, has called on members to avenge the death of two of its leaders killed in an Israeli army raid.
Israeli troops fired rockets into the building before demolishing it
Two other Palestinians and an Israeli soldier were killed after Israeli troops surrounded a building in a refugee camp in Nablus, where suspected militants were staying.
Senior Hamas leaders said the group was still committed to its ceasefire, but warned that "violations" would not go unanswered.
The BBC's Nick Thorpe in Jerusalem says this is one of the most serious incidents since Palestinian militant groups declared a unilateral ceasefire five weeks ago.
Hamas' Izzedine al-Qassam Brigades identified their dead as Fayez Assader, 26, a leader in Nablus, and Khamis Abu Salem, 22.
In a statement, the group said: "We call on all cells to answer this crime and teach the enemy the right lesson.
"The crimes of the Zionist enemy, perpetrated against our
people, and its daily violations will not go without the enemy
paying a commensurate price."
Israeli military sources said when they approached the building early on Friday in the Askar refugee camp in Nablus, a known Hamas stronghold, they were shot at from its third floor.
Israeli soldiers responded by reportedly firing an anti-tank missile at the building, setting off several explosions.
The BBC's Simon Wilson in Nablus says hundreds of people gathered to look at the wreckage of the building destroyed before the Israeli troops withdrew.
A 20-year-old man was killed when Israeli troops opened fire on people throwing stones at them, and another bystander died from the effects of tear gas sprayed by soldiers.
The Israeli military said the source of the blasts was either a crude explosives lab or a stash of weapons.
Residents said eight families were made homeless, Reuters news agency reported.
Sharp US slate
On Thursday, the US Secretary of State, Colin Powell, criticised Israel and its planned security fence.
Toughening his stand, he warned Israel of the conditions attached to US aid to the country.
Mr Powell said the Bush administration understood Israel's desire for a fence, but warned it must not come at a cost to its neighbours' rights.
"It's when the fence begins to intrude on land that is not on the Israeli side of the green line, or starts to intrude in a way that makes it more difficult for us to make the case for a viable Palestinian state, that it is appropriate for us to say to our Israeli friends, look, we have a problem here."
He also put pressure on the Palestinians, insisting the current ceasefire is not enough and that the Palestinian authority must "go after the organisations with the capacity of conducting terrorist acts", such as Hamas and Islamic Jihad.