JERUSALEM — In a sudden crescendo of violence on Monday evening, militants in Gaza fired rockets toward Jerusalem and the Israeli military responded with airstrikes. The exchange followed a police raid that morning on the Aqsa Mosque, one of Islam’s holiest sites, that left hundreds of Palestinians and a score of police officers wounded, capping weeks of unrest in the city.
At least 45 rockets were fired from Gaza shortly after 6 p.m., the Israeli Army said. At least one landed in a village in the hills west of Jerusalem, causing damage to houses but no casualties.
Palestinian health officials in Gaza said nine residents of Beit Hanoun, in northern Gaza, including three children, were killed in an Israeli airstrike.
An Israeli military spokesman said he could neither confirm nor deny Israeli responsibility for the deaths and suggested that they might have been a result of friendly fire. But the spokesman confirmed that there had been an Israeli strike in the area.
The Israeli Army said in a statement that an Israeli airstrike had killed three Hamas operatives.
Separately, militants fired an anti-tank missile along the Gaza perimeter toward an Israeli vehicle, wounding the driver.
Hamas claimed responsibility for the rockets, saying that it had acted to protect Jerusalem after the police raid on the mosque compound in Jerusalem. Islamic Jihad, a separate militant group, claimed the anti-tank missile attack, as well as scores of other rocket attacks.
Bomb sirens sounded across the regions closest to the Gaza perimeter, as well as in the Jerusalem area.
The attacks capped a day of violence in Jerusalem, which began when police entered the mosque compound around 8 a.m. and fired rubber-tipped bullets and stun grenades at stone-throwing Palestinians. The Palestinians had stockpiled stones at the site in expectation of a standoff with the police and Jewish far-right groups.
By the afternoon, more than 330 Palestinians had been injured, with at least 250 hospitalized, according to a representative of the Palestinian Red Crescent. One person was hit in the head by a bullet and was in critical condition, the medical aid group said, with at least two more in serious or critical condition.
At least 21 police officers were injured, according to the police.
Tensions were already high in Jerusalem. Palestinians have been demonstrating daily since April against the planned expulsions of Palestinians from their homes in the city, amid frequent clashes over restrictions on Palestinian access to the city’s ancient core.
The unrest was long predicted to come to the boil on Monday, when far-right Israelis were scheduled to make a provocative march through the Muslim Quarter of the Old City.
The march is an annual event to mark the capture of East Jerusalem during the Arab-Israeli war in 1967, an anniversary known in Israel as Jerusalem Day. Israel subsequently annexed that part of the city, a move that most of the world has not recognized. Palestinians claim East Jerusalem as the capital of a future state, and view the day’s celebrations as a provocation.
The Israeli government did little to de-escalate the tensions until Sunday night, when it took several measures to try to tamp down the conflict.
With minutes to go before the march began on Monday, the government restricted it to a less contentious route to avoid a head-on confrontation.
The Israeli police also decided Monday to block Jews from entering the Aqsa compound, known to Jews as the Temple Mount and to Muslims as the Noble Sanctuary.
On Sunday, the Israeli Supreme Court delayed a decision on the expulsion of six Palestinian families from their homes in East Jerusalem, a ruling that was to have been issued Monday, trying to defuse another potentially explosive element.
But those measures failed to prevent the escalating violence.
After days of threats from Hamas, the Islamic militant group, that it would respond to Israeli actions in Jerusalem, the group’s military wing set an ultimatum, calling on Israel to withdraw its security forces from the Aqsa Mosque compound and another area of East Jerusalem, and to release all Palestinians detained during the recent disturbances by a 6 p.m. deadline on Monday.
Shortly after that deadline, the missiles began.
Anticipating the conflict, the Israeli military had already closed areas and roads near the border of the Gaza Strip, the Palestinian coastal territory where Hamas holds sway.
Militants in Gaza had fired rockets into Israel overnight Sunday, after sending incendiary balloons into Israeli farmland for the past several days, but the rockets had hit only open areas. Israel returned fire, barred fishermen from the territory from accessing the sea and shut a key crossing between Gaza and Israel.
Lt. Col. Jonathan Conricus, a spokesman for the military, said the army had been “looking to stabilize the situation” and avoid escalation.
But with tensions spiraling, the army chief of staff, Lt. Gen. Aviv Kohavi, postponed a major preplanned military exercise by a day and ordered the military “to focus all efforts on preparations and readiness for escalation scenarios,” according to a military statement.
Videos posted on Twitter showed scenes of chaos earlier in the day both outside and inside the mosque, where some worshipers could be seen sheltering from explosions while others threw stones and set off fireworks. In another clip, police officers were seen striking a man being detained in part of the mosque compound. By early afternoon, the police had retreated from the site.
Another video released by the police showed young men throwing stones from the perimeter of the mosque compound onto the land below. A separate clip, taken by a surveillance camera, appeared to show a Jewish man swerving into a Palestinian who had been throwing stones at his car. Palestinians pulled open the car doors before a policeman chased them away.
The Hadassah Medical Center reported that a 7-month-old girl was also treated after being lightly injured in the head by a rock.
Witnesses at the mosque reacted with shock at the Israeli police tactics at one of the world’s holiest sites. “Why have they been attacking the Aqsa Mosque during Ramadan?” asked Khaled Zabarqa, 48, a lawyer who said he had been praying at the mosque compound before escaping after the first shots were fired.
“The Aqsa Mosque is a sacred place for Muslims,” Mr. Zabarqa added. “Israel is starting a religious war.”
Mr. Zabarqa and other witnesses said the fighting began around 8 a.m. after the police entered the mosque compound and began firing.
The Israeli government said the police responded only as a last resort after the Palestinians had started the clash by throwing stones at them.
“We wanted today to pass as quietly as possible,” said Mark Regev, a senior adviser to Prime Minister Benjamin Netanyahu of Israel. “Unfortunately, Palestinian extremists had the opposite goal.”
Mr. Netanyahu praised the police for “taking a strong stand.”
“A struggle is now being waged for the heart of Jerusalem,” he said. “It is not a new struggle. It is the struggle between intolerance and tolerance, between lawless violence and law and order,” he added, casting the confrontations as the continuation of a sectarian struggle for the city over hundreds of years.
Jerusalem Day is always fraught. But the atmosphere was especially febrile on Monday because the confrontations followed weeks of escalating tensions in the city, where restrictions on Palestinian access to the Old City during the holy month of Ramadan, a far-right march through the city center in April, and street assaults by both Jews and Arabs have all contributed to a volatile atmosphere.
In recent days, pressure rose further as protests grew over the looming expulsion of several Palestinian families from their homes in Sheikh Jarrah, East Jerusalem. For Palestinians and their advocates, the case has become a stand-in for the wider campaign to force out Palestinians from parts of East Jerusalem and for their past displacement in the occupied territories and within Israel.
Tensions escalated again Friday night, as the police fired rubber-tipped bullets and stun grenades and Palestinians threw stones following prayers at the Aqsa compound. Video showed some grenades landing inside the mosque.
The tensions were compounded when a Palestinian killed an Israeli in a drive-by shooting in the occupied West Bank last week, setting off a manhunt by the Israeli Army in the West Bank and raids on Palestinian homes. Israeli soldiers later shot dead a Palestinian teenager in a separate incident.
A court decision on the families’ evictions in East Jerusalem, scheduled for Monday, was postponed on Sunday, in part to try to defuse the rising tensions.
Nevertheless, scuffles broke out in Sheikh Jarrah on Monday afternoon, as a group of far-right lawmakers tried to mark Jerusalem Day by forcing their way into the street inhabited by the Palestinians listed for eviction. A group of leftist and Arab lawmakers blocked their path, setting off a brief scrum, before at least one far-right lawmaker, Itamar Ben Gvir, broke through the Arabs’ lines.
“Everything is connected,” one of the Arab lawmakers, Aida Touma-Sliman, said of the day’s many intertwining tensions. The various standoffs across Jerusalem reflected the “struggle of a people under occupation who want to liberate their land, houses and souls,” she said.
The violence comes against a backdrop of political instability in both Israel and the occupied territories. The Palestinian Authority recently canceled what would have been the first Palestinian elections in 15 years.
And after a fourth Israeli election in just two years, Israeli opposition parties are locked in negotiations to form a coalition government and replace Benjamin Netanyahu, the country’s prime minister. Mr. Netanyahu is serving in a caretaker capacity as he stands trial on corruption charges.
Myra Noveck contributed reporting from Jerusalem, Gabby Sobelman from Rehovot, Israel, an Iyad Abuhweila from Gaza City.