Kevin Frayer, Associated Press
Medics transport a wounded Israeli Thursday from the Yeshiva Mercaz HaRav, a Jewish religious school, after the attack.

JERUSALEM — A lone gunman stormed a well-known Jewish religious school in Jerusalem Thursday night and killed eight people in the deadliest attack in the city in more than four years.

Armed with a pistol and machine gun, the attacker walked into the unguarded Yeshiva Mercaz HaRav and opened fire in the library and nearby dormitory before police killed him.

The shooting was the latest setback for the Bush administration's faltering attempts to broker an Israeli-Palestinian peace deal by year's end, and some Israelis worry that it could be the beginning of another spasm of violence.

"I saw a terrible scene of young guys in the library holding holy books in their hands," said Yerach Tucker, a volunteer medical responder who got to the scene while the attack was still under way. "You see the fear in the eyes of the Israelis."

There were no immediate, credible claims of responsibility, though Hezbollah television in Beirut said the shooting was carried out by a new group that seeks to avenge the assassination of Imad Mughniyeh, a leader of the militant Lebanese Shiite Muslim group. Mughniyeh was killed last month by a car bomb in Damascus, the Syrian capital, an attack that many suspect Israel orchestrated.

Leaders of the militant Sunni group Hamas in the Gaza Strip called the attack an inevitable response to last week's Israeli military operation in Gaza that killed more than 100 Palestinians.

"There will always be someone who will avenge Palestinian blood," Munir Masri, a Hamas member of the Palestinian legislature, told Al Aqsa television after the attack.

Though the name of the killer at the school wasn't released, Israeli government officials said he lived in East Jerusalem, which suggests that he was an Arab.

The attack was the deadliest in Jerusalem since Feb. 22, 2004, when a suicide bomber blew himself up on a bus, killing eight people and wounding 60 others.

Israeli Prime Minister Ehud Olmert and Palestinian Authority President Mahmoud Abbas both denounced the shooting, and negotiators on both sides said the attack shouldn't derail the effort to revive peace talks.