The state-run SANA news agency said two civilians were killed in the after-midnight airstrikes carried out by Israeli warplanes from outside the Syrian airspace on positions around the capital Damascus.
Meanwhile, the Syrian Observatory for Human Rights said 21 fighters, including five Syrians, were killed as well as two civilians, a man and his wife.
The London-based watchdog said most of the killed fighters were Iranians from the Quds Force, a unit in Iran's Islamic Revolution Guards Corps.
The death toll is likely to grow as many of the wounded fighters are in critical condition, it added.
After midnight on Wednesday, people in Damascus were rattled by the repeated sound of explosions from different directions, many of whom also saw the air defense missiles flying in the air, lighting up the sky over the Syrian capital.
A military statement released by SANA said Israeli warplanes from the occupied Golan Heights and the Lebanon's Marj Ayoun area targeted the vicinity of Damascus with a number of missiles.
"Our air defense was able to intercept the hostile missiles, destroying most of them before reaching their targets," said the statement.
The Observatory said the Israeli missiles targeted military positions in the Sehnaya, Kisweh and Sasa' areas in southern Damascus, the Mazzeh air base and Jdaidet Artouz in western Damascus as well as in the Qudsaya suburb northwest of Damascus.
It said weapons depots of the Quds Force and one of its training camps were destroyed in the airstrikes, which also targeted surface-to-air missile batteries and positions of the Syrian army.
Israel said the airstrikes came in retaliation for allegations that missiles were fired from Syria toward Golan Heights earlier on Tuesday.
"The rules have changed: anyone who shoots at the State of Israel during the day will not sleep at night," Israeli Defense Minister Naftali Bennett said following the strikes.
Israel has conducted hundreds of airstrikes in Syria throughout the eight-year conflict, most of them against what it says were targets of Iran-backed militia groups such as the Lebanese Hezbollah.