Shmuel Ben-Ruby, another Israeli police spokesman, said that a 13-year-old boy was among the casualties, who were lightly wounded.
He said police arrested the armed man at the scene.
The future status of predominantly Arab East Jerusalem has been a key issue in stalled peace talks between Israel and the Palestinians.
Israel annexed East Jerusalem and declared the whole city its capital after the 1967 Middle East war, a move not recognised by the international community.
The Palestinians want East Jerusalem as the capital of a future independent state and have accused Israel of trying to alter the social make-up of the area by destroying Palestinian homes and building Jewish settlements.
George Mitchell, the senior US envoy to the Middle East, was due to arrive in the region on Saturday for a fresh round of talks aimed at restarting the peace process.
Negotiations have been stalled since the Israeli military launched its 22-day offensive in the Gaza Strip in December last year.
His visit comes ahead of reports of a possible meeting between Binyamin Netanyahu, the Israeli prime minister, Mahmoud Abbas, the Palestinian president, and Barack Obama, the US president, at the UN General Assembly later in September.