The killing of eight people at a Jewish religious college by a Palestinian gunman will not derail peace talks, the Israeli government has said.
The gunman was shot dead after opening fire with an assault rifle inside a crowded library at the Mercaz Harav seminary in West Jerusalem.
Israeli police said the attacker was a Palestinian resident of East Jerusalem.
Some Israelis have called for peace talks with the Palestinians to end but Israel has said they will continue.
Palestinian Authority President Mahmoud Abbas condemned his Hamas rivals - who are in control of Gaza - for hailing the attack.
Hamas described the shooting as a "natural reaction" to Israeli military actions in the Gaza Strip last week that left more than 120 Palestinians dead.
The Israeli operations aim to stop Palestinian militants from firing rockets from Gaza that have been hitting its border towns since it ended its permanent military presence in Gaza in 2005.
The Palestinian leadership has been split between Mr Abbas's Fatah faction, in control of the West Bank, and Hamas, who have ruled Gaza since forcing out Fatah last year.
The Palestinians - without Hamas - have been engaged in a US-launched peace process with the Israelis since late last year.
"Those celebrating these murders have shown themselves to be the enemies not only of Israel, but the enemies of peace and reconciliation," said Mark Regev, the Israeli government spokesman.
While UN Secretary General Ban Ki-moon condemned the attack, the Security Council failed to agree on a statement on Thursday night.
The Libyan representative said his country and several others wanted the council to couple any condemnation of the Jerusalem shootings with one against Israel for killing large numbers of civilians, including children, in Gaza.
But Russian envoy Vitaly Churkin - who currently chairs the Security Council - asked how bad a terrorist attack had to be for specific condemnation, without going through the entire history of the Israeli-Palestinian conflict.
The gunman entered the library at the Mercaz Harav seminary on Thursday evening, where about 80 students were gathered, and fired an AK-47 rifle for several minutes, witnesses say.
DEADLY ATTACKS IN ISRAEL
4 Feb 2008: One dies, Dimona suicide bombing
29 Apr 2007: Three die, Eilat suicide bombing
17 Apr 2006: Nine die, 40 wounded, suicide bombing near old bus station in Tel Aviv
30 Mar 2006: Four die, Kedumim suicide bombing
29 Dec 2005: Thee die, suicide bombing near Tulkarm
5 Dec 2005: Five die, Netanya suicide bombing
26 Oct 2005: Six die, Hadera market suicide bombing
12 July 2005: Two die, Netanya suicide bombing
25 Feb 2005: Five die, 50 hurt, suicide bombing outside Tel Aviv nightclub
13 Jan 2005: Six die, suicide bombing at Karni crossing
Students scrambled to flee the scene, jumping out of windows, witnesses said. Most of those killed were reported to be teenagers. At least nine people were injured.
A student reportedly shot the gunman twice before an off-duty Israeli army officer killed him.
The head of the Zaka rescue service described a scene of carnage at the seminary.
"The whole building looked like a slaughterhouse. The floor was covered in blood," said Yehuda Meshi Zahav. "The floors are littered with holy books covered in blood."
A previously unknown group called the Jalil Freedom Battalions - the Martyrs of Imad Mughniyeh and Gaza claims to have carried it out, according to Lebanese Hezbollah media.
Imad Mughniyeh, a senior Hezbollah leader and military commander, was killed in a car bomb in Damascus on 12 February.
HAVE YOUR SAY
As long as Gaza keeps firing missiles into Israeli towns, Israel will do everything to defend itself
The fact that the school is at the heart of the settler movement in the occupied West Bank may have been the reason why it was targeted, BBC Middle East editor Jeremy Bowen says.
Many of its students are on special courses that combine religious study with service in combat units in the Israeli army.
There will be an Israeli response to this attack, our Middle East editor adds - the question is how severe it will be.
Mr Ban criticised the "deliberate killing and injuring of civilians" in what he called a "savage attack".
But in the Hamas-controlled Gaza Strip, gunmen fired into the air after news broke about the attack.
A loudspeaker in Gaza City reportedly broadcast the message: "This is God's vengeance."
Hamas spokesman Sami Abu Zuhri said the group "blesses the heroic operation in Jerusalem" calling it a "natural reaction" to Israeli attacks.