JERUSALEM — The Israeli army said it attacked military targets in Syria early Wednesday following a missile launch into Israel the previous day.

An independent war monitoring group said 23 were killed, mostly non-Syrians, raising the specter of retaliatory strikes between the regional rivals.

The Israel Defense Forces said in a statement it struck dozens of targets belonging to Iran’s elite Quds Force as well as the Syrian army, including surface-to-air missile sites, headquarters, munitions warehouses and military bases.

Israel said the strikes were in response to the launch into northern Israel early Tuesday of four reportedly Syrian-based missiles, which were downed by Israel’s air defense systems. Officials said Iran was behind that launch.

“I made it clear that whoever hurt us — we will hurt him,” Prime Minister Benjamin Netanyahu said in a tweet. “This is what we did tonight against military targets of Iranian Quds force and Syrian military targets in Syria.”

Syria’s state-run Syrian Arab News Agency (SANA) reported that missiles were launched toward Damascus about 1:20 a.m. over the Golan Heights and Lebanon. The service reported two civilian deaths in the attack in Beit Saber, south of the capital.

Fires and evidence of damage were reportedly visible at sites around Damascus.

The Britain-based Syrian Observatory for Human Rights said the missiles killed 21 non-civilians — five from the Syrian army and the rest from the Quds Force and allied militias, most of whom were non-Syrian.

SANA did not report the military deaths, but it often plays down attacks on Damascus and other government-controlled areas. The agency quoted the governor of Damascus province, who said rescue teams were still pulling civilians from under the rubble, having so far found three alive.

Israeli media, citing military sources, said the IDF struck about 20 targets, more than half of them belonging to Iran. The army said it hit multiple Syrian-controlled antimissile sites after the system was activated in the attack. One of the targets was reportedly the Quds Force headquarters at Damascus airport.

The military said it was preparing for any Iranian response and advised civilians to follow any defensive guidance that might be announced.

Russia, which has military facilities in the area, said it was in touch with its allies over the attack. Deputy Foreign Minister Mikhail Bogdanov called Israel’s actions “a wrong move,” according to the Interfax news agency.

The attacks come at a fraught political moment in Israel, occurring on the final day allowed to former army chief of staff Benny Gantz in his attempts to put together a governing parliamentary coalition. Neither Gantz, nor Netanyahu before him, has been able to secure a majority since elections in September.

One option Gantz is reportedly exploring is forming a minority government with backing from a faction of Arab-Israeli parliamentarians, an idea Netanyahu has savaged as a threat to Israel’s security. The prime minister’s Likud party on Wednesday cited the Syria action to warn against any arrangement “that depends on terror supporters.”

Gantz welcomed the strike, calling it a “significant blow” to Iranian forces. “Even during times of domestic political dispute, we fully support all responsible acts by the government aimed at strengthening the security of Israeli citizens.”

Israelis are increasingly frustrated by almost a year of government gridlock at a time of rising tensions in the region. The operation in Syria follows two days of heavy military action between Israel and militants in the Gaza Strip. At least 34 Palestinians were killed in Israeli strikes, and rockets from Gaza rained down across southern Israel.

“The rules have changed: Anyone who shoots at the State of Israel during the day does not sleep at night,” Israeli Defense Minister Naftali Bennett said in a statement after the Syria strikes. “That’s what happened last week, and that’s what is happening this week.”

Dadouch reported from Beirut. Ruth Eglash in Jerusalem contributed to this report.