The Israeli government said peace talks would continue as thousands gathered outside a rabbinical seminary on Friday in Jerusalem for the funerals of eight students who were killed Thursday by a Palestinian gunman.

israeli-mourners-cp-4474026

Israeli mourners carry the body of one of eight students at the beginning of their funeral procession outside Mercaz Harav seminary in Jerusalem on Friday. ((Dan Balilty/Associated Press))

People packed nearby balconies to observe the ceremony for the dead students, all of them aged 15 to 19 except for one, who was 26.  Nine others were wounded in the Jerusalem attack, the city's first in more than four years.

Each body was brought up through the crowd to the front during the emotional ceremony outside the school.

Speakers at the ceremony said the shooting would not shake their faith or commitment to Israeli settlement in the West Bank. The school is associated with the Jewish movement to settle in the area.

The ceremony was followed by a funeral procession that later fanned out to eight different locations across Israel and the West Bank. According to Jewish customs, the dead must be buried before sunset on Friday, which marks the start of the Sabbath.

The gunman, who, according to reports, came from East Jerusalem and was a driver at the seminary, entered the school carrying a box with an AK-47 and a pistol. He then opened fire on a crowded nighttime study session, and was later killed.

Identified as 25-year-old Alaa Abu Dheim, he had been arrested by Israeli authorities four months ago but released after two months, according to news reports.

Hamas earlier took responsibility for the attack but then backtracked. Abu Dheim's family, who set up a mourning tent and hung green Hamas flags outside their home, told the Associated Press he was not a member of a militant group.

He was intensely religious and had been transfixed in recent days by the news of bloodshed in the Gaza Strip, according to his sister, Iman Abu Dheim.

"He told me he wasn't able to sleep because of the grief," she said.

Israeli defense officials confirmed only that the gunman came from Jabel Mukaber in east Jerusalem.

Despite the attacks, the Israeli government said it would move ahead with peace efforts.

"Talks will continue," a spokesman with the Foreign Ministry told the Jerusalem Post.

The seminary attack came a day after Palestinian President Mahmoud Abbas agreed to resume peace negotiations with Israel. He had broken off talks following the Israeli military incursion into the Gaza Strip to stop Hamas from firing rockets into the southern part of the country.

At his West Bank headquarters, Abbas condemned the attack. "The president condemned all attacks that target civilians, whether they are Palestinian or Israeli," a statement said.

With files from the Associated Press