
Police identified the gunman as a 21-year-old resident of east Jerusalem, the sector of the city annexed by Israel after the 1967 Six-Day War.
There has been no indication that he had prior involvement in militant activity or was a member of an established Palestinian armed group.
He was killed by police following a brief chase after the shooting.
In a statement, police said they had arrested “42 people for questioning” overnight, “some of them members of the terrorist’s family”.
Others detained included residents of the gunman’s neighbourhood, police said.
In a separate statement, police said the force had been placed on the “highest level” of alert following the attack in Neve Yaakov neighbourhood of east Jerusalem.
Israel’s police chief Kobi Shabtai called the shooting “one of the worst attacks (Israel) has encountered in recent years.”