JERUSALEM — Weeks of simmering tensions in Jerusalem between Palestinian protesters, the police and right-wing Israelis suddenly veered into military conflict on Monday, as a local skirmish in the decades-long battle for control of the city escalated into rocket fire and airstrikes in Gaza.

After a raid by the Israeli police on the Aqsa Mosque in Jerusalem left hundreds of Palestinians and a score of police officers wounded, militants in Gaza responded by firing a barrage of rockets at Jerusalem, drawing Israeli airstrikes in return.

The catalyst for the escalation was the conflict over recent Israeli efforts to remove Palestinians from strategic parts of the city. The issue became a rallying cry for Palestinians, who saw the moves as ethnic cleansing and illegal, and right-wing Israeli Jews, who said they were fighting for their property as landowners while also attempting to ensure Jewish control over East Jerusalem.

The dispute, focused on a single Jerusalem neighborhood, has exploded into a major flare-up in the Israeli-Palestinian conflict, gaining world attention after a period in which the Palestinian cause had been largely marginalized — by the United States under President Donald J. Trump, by the Arab countries that normalized relations with Israel, and by Israel, ruled by a right-wing government for more than a decade.

Hamas, the Islamist militant group that controls Gaza, had fired rockets at Jerusalem for the first time in seven years. Israeli airstrikes left at least 20 Palestinians, including nine children, dead, according to Palestinian officials. And the region was bracing for a cycle of reprisal attacks.