The attackers were from the city of Umm Al Fahm near the occupied West Bank.
Video obtained by CNN showed part of the lethal confrontation in the plaza area of the Noble Sanctuary or Temple Mount.
The channel said the official was seen on security footage behaving suspiciously.
The perpetrators - who use knives, guns and even vehicles as weapons - often appear to be acting autonomously as "lone wolves".
Friday was the deadliest day of civilian casualties since March 8, 2016, when three Palestinians were killed in Tel Aviv after carrying out an attack that left one tourist dead and 12 Israelis wounded.
Two police officers in Jerusalem were killed in what officials say was a terror attack in the Old City, one of Israel's holiest area.
The Israeli military said troops opened fire after Palestinians hurled explosives and blocks at them.
U.N. Secretary-General Antonio Guterres is condemning the attack by three assailants in the Old City of Jerusalem that killed two Israeli policemen and warns that the incident has the potential to ignite further violence.
On Fridays, the site is open for Muslim prayer only.
In an apparent effort to ease tensions, the Israeli prime minister issued a statement saying there would be no change to the status quo in which only Muslim prayer is permitted, a message he reiterated in his phone call with Mr Abbas, according to Mr Netanyahu's office.
Israeli Chief of Police Roni Alsheikh described Stawi as a "good friend" who was always "professional, steadfast and vigilant" and "the first to volunteer to help a friend in need".
"The Jordanian government opposes all damage done to Muslims' ability to carry out, freely and without obstacles, their religious rituals at their holy sites", said a Jordanian government spokesperson.
Israel's minister of public security Gilad Erdan said "the terrorists had desecrated the sanctity" of the site.
Following the attack, all entrances to the Old City have been put under lockdown.
Gradually reopening the site to worshippers and visitors "will be based on an estimate that will be made Sunday", he said.
Sami Abu Zouhri, spokesman for Hamas, said in a statement that "the Jerusalem operation is a natural response to Israeli terrorism and the desecration of the Al-Aqsa Mosque". No group assumed responsibility for the attack. The investigation is ongoing.
Following the attack, Israel briefly detained then released the grand mufti of Jerusalem.
He said the investigation remained ongoing, hinting that the holy site could be closed until Sunday.