Armed Israeli police exit the Temple Mount compound in Jerusalem's Old City on Friday. (Abir Sultan/European Pressphoto Agency)

In a bold attack outside a site sacred to Muslims and Jews, three Arab Israelis armed with a pistol and homemade machine guns shot and killed two Israeli police officers early Friday at the entrance to the al-Aqsa Mosque compound.

The three assailants were then chased into the courtyard of the mosque complex, where they were shot and killed by Israeli security forces, authorities said.

Hours after the early-morning shootout, Israeli forces still blocked access to the mosque area because of security concerns.

The rare closure marked the first time in years that Israeli authorities stopped Muslims of all ages from attending Friday prayers at the holy site.

Israel’s domestic security service, Shin Bet, said the three attackers were Israeli citizens from an Arab town in northern Israel called Umm al-Fahm and that they shared the same last name, suggesting they may have been related.

The two dead Israeli Border Police officers were members of Israel’s small Druze community. Kamil Shnaan, 22, was the son of a former member of parliament. Hael Sathawi, 30, left behind a wife and a 3-week-old son.

The Druze follow an offshoot of Shiite Islam and are seen by some Sunni militant factions as apostates.

Police said the assault began just after 7 a.m. close to the Lion’s Gate into the Old City, near one of the entrances to the complex that holds al-Aqsa Mosque and the golden Dome of the Rock, an ancient esplanade revered by Muslims as the Noble Sanctuary and by Jews as the Temple Mount.

The site is a scene of frequent clashes between Palestinians and Israeli forces, but not shootouts involving multiple fatalities.

Israeli police released a security camera clip that showed one of the attackers rushing toward an Israeli Border Police officer and shooting him in the back.

A photograph published on one of the attacker’s Facebook pages a day before the assault shows two of the gunmen posing for a selfie in front of the Dome of the Rock. The caption reads, “Tomorrow our smiles will be sweeter.”

Israeli officials identified the ­attackers as Muhammad Ahmed Jabarin, 29; Muhammad Hamid Jabarin, 19; and Muhammad Ahmed Mufdal Jabarin, 19. Arabs constitute 20 percent of the Israeli population.

After the attack, Palestinian ­Authority President Mahmoud Abbas placed a telephone call to Israeli Prime Minister Benjamin Netanyahu. 

According to Wafa, the official Palestinian news agency, “Abbas expressed his strong rejection and condemnation of the fatal shootout that took place near Al Aqsa mosque, as well as his rejection of any violent incidents from any side, especially in places of worship.”

Jerusalem’s police chief , Yoram Halevi, canceled Friday prayers at the mosque and ordered the complex cleared and the entrances shut. The narrow alleys around the mosque were filled with Israeli police and soldiers.

During the phone call, Abbas “called on Netanyahu to end the closure imposed on the holy site, warning of the consequences of such measures.”

In a statement, Netanyahu said Friday’s closure was for security reasons and did not represent a change in what is called the ­“status quo” agreement about the care, custody and access to the religious site.

The Associated Press reported that a top Muslim cleric at al-Aqsa Mosque, Jerusalem’s grand mufti, Sheikh Mohammed Hussein, was brought in for questioning at the Israeli police station in the Old City, according to his son.

“We insist on reaching the al-Aqsa Mosque and performing prayers there,” Hussein said.

Before his detention, Hussein told the Palestinian news agency Maan that it was the first time that Israel had put a blanket block on Muslims performing Friday prayers at al-Aqsa since 1967.

Israeli reporters said the last time the mosque was closed for Friday prayers was 1990.

Several times before, Israeli ­authorities have imposed restrictions on Muslims entering the mosque area, including temporarily banning men under 50 in 2014 during a period of heightened violence.

Israeli police said the three assailants were armed with a knife, a pistol and two homemade machine guns, the type manufactured in clandestine workshops in the West Bank. These kinds of weapons have been used in attacks in recent years, including a mass shooting in 2016 at a Tel Aviv food court in which four people were killed.

Soon after the attack, Netanyahu called a meeting of his top security ministers as condemnations against the assault poured in.

The U.S. ambassador to Israel, David Friedman, tweeted: “Shocked and horrified by the despicable attack today in Jerusalem. Terrorism must be condemned by all and defeated. We pray for the victims.”