No serious injuries were reported at the site, which lies in the Israeli-occupied walled Old City and is revered by Muslims as the Noble Sanctuary and by Jews as the Temple Mount where two temples once stood.
A police spokeswoman said Palestinians had prepared makeshift barricades and used rocks, metal bars and flares to attack police who came to dismantle them.
Violence at the site has flared in the past year as Palestinians have been riled by visits by non-Muslims, including ultranationalist Jews, to the compound.
Police used stun grenades to push protesters back into the mosque and stepped inside its entrance way to close its main doors, which the spokeswoman said had been jammed open by rock-throwers.
Israeli police, following long-standing procedures, do not venture further into the mosque, Islam’s third holiest shrine, and violence usually subsides quickly, as it did on Sunday, after Palestinian demonstrators take refuge inside.
Jewish ultranationalists have been pushing the Israeli government to allow Jewish prayer on the compound outside al-Aqsa, which stands above the Western Wall.
Such worship, certain to stir Muslim anger, has been banned on the plaza by Israel since it captured East Jerusalem, and its Old City, in the 1967 Middle East war.
After Sunday’s violence ended, a right-wing Israeli cabinet minister visited the compound to mark Tisha B’Av, when Jews lament the temples’ destruction.
Israel regards all of Jerusalem as its indivisible and eternal capital, a claim not recognized internationally.
Palestinians want East Jerusalem, annexed by Israel after the 1967 war, as the capital of a state they aspire to establish in the occupied West Bank and in the Gaza Strip.