Eight people were killed and several wounded when a gunman opened fire at a Jewish religious seminary in west Jerusalem.
Witnesses said the attacker entered a busy dining hall at the Mercaz Harav seminary and began firing at some 80 students gathered there.
Emergency workers rushed to the scene. One medic told Israeli television there was still shooting when he arrived and described "horrific" scenes inside the building.
Israeli security personnel shot the attacker dead, surrounded the school and searched inside.
A witness described hiding under cars, and then entering the school to see students lying dead and injured on the floor.
Shock and grief at the attack turned to anger among students who gathered outside the school.
The Mercaz Harav seminary is a well-known centre for Jewish studies. Many students are high-school age and young adults.
Some Palestinians took to the streets in the Gaza Strip. Gunmen fired into the air in celebration. The militant group Hamas praised the attack.
It was the first major attack in Jerusalem since 2004, coming at a time of heightened tension after Israeli forces killed more than 120 Palestinians during operations in the Gaza Strip in recent days.