Witnesses said the gunman went into a crowded hall during dinner at the Mercaz Harav seminary in the city's Kiryat Moshe quarter and opened fire.
The assailant, who Israeli police said was a resident of East Jerusalem, was shot dead by an Israeli army officer.
The attack is the worst of its kind in Israel for a number of years.
The White House has led international condemnation but the Palestinian Islamist group Hamas called the attack "heroic" while not claiming responsibility.
When we got in... we saw young, 15-, 16-year-old guys lying on the floor with their Bibles in their hands - all dead on the floor
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.