Israeli police chased the gunman on motorcycles before shooting and killing the assailant who killed two and injured four others earlier
A Palestinian opened fire from a car in Jerusalem Sunday and again as police chased him, killing two people, authorities said, after concerns over the potential for a new upsurge in violence.
The gunman was killed soon after carrying out the attack near police headquarters, close to the line dividing mainly Palestinian East Jerusalem from the mostly Jewish western sector of the city.
The shooting rampage comes at a time of increased Jewish visitors to the flashpoint Al-Aqsa mosque compound in Jerusalem for the holidays of Rosh Hashanah, which was last week, and Yom Kippur, which begins Tuesday evening.
Police said the 39-year-old assailant fired in the direction of a tram station in the area, seriously wounding a woman.
He then continued at high speed and shot at a car, leaving another woman badly hurt, they added.
One of the women, a 60-year-old, was reported by medics to be in critical condition after being shot in her upper body.
The attacker then headed toward the nearby neighbourhood of Sheikh Jarrah in Israeli-annexed East Jerusalem, where a number of upscale hotels are located, and got out of his car, police said.
As officers approached him by motorcycle, he opened fire on them.
Police returned fire and killed him, but two officers were wounded, including one seriously, they said.
Hadassah hospital later reported that two of the victims had died, without providing further details.
Police said the attacker was from the Silwan area of East Jerusalem.
Israeli Prime Minister Benjamin Netanyahu, speaking at the start of a cabinet meeting on Sunday, saluted the police, saying they had "acted rapidly and very firmly against the terrorist, who was eliminated".
Hamas welcomes attack
A spokesman for Palestinian movement Hamas, which runs the Gaza Strip, welcomed the attack.
Fawzi Barhoum called it "a natural reaction to the crimes and violations of the occupation against our people".
The Palestinian Islamic Jihad movement also praised that attack, calling it "heroic".
The Al-Aqsa mosque compound is holy to both Muslims and Jews, who refer to it as the Temple Mount.
The site is central to the Israeli-Palestinian conflict, with Palestinians fearing that Israel may one day seek to assert further control over it.
Last year's Jewish high holidays led to clashes and marked the start of an upsurge in Palestinian gun, knife and car-ramming attacks.
Violence since October 2015 has killed at least 232 Palestinians, 34 Israelis, two Americans, one Jordanian, an Eritrean and a Sudanese national, according to an AFP count.
Most of the Palestinians were carrying out attacks, according to Israeli authorities.
Others were shot dead during protests and clashes, while some were killed in air strikes on the Gaza Strip.
Many analysts say Palestinian frustration with the Israeli occupation and settlement-building in the West Bank, the complete lack of progress in peace efforts and their own fractured leadership have fed the unrest.
Israel says incitement by Palestinian leaders and media is a leading cause of the violence.
The vast majority of the attacks have been carried out by lone-wolf assailants, Israeli authorities say. Many have been young people, including teenagers.