Israel retaliated by attacking dozens of Iranian targets inside Syria, including areas around the capital Damascus.
Benjamin Netanyahu said Israel’s action was a “clear message to Assad” that if the Syrian Army acts against Israel, “we will act against it”.
Iran has not claimed responsibility for the attacks, but Israel blamed Iranian Quds forces inside Syria for firing the rockets.
In a brief video address, Mr Netanyahu said Israel carried out a “very broad attack against Iranian targets in Syria.”
He added: “We are in the midst of a protracted battle and our policy is clear: we will not allow Iran to entrench itself militarily in Syria.”
The UK joined calls for restraint and denounced the Iranian rocket fire.
A spokesman for Prime Minister Theresa May said: “The Prime Minister condemned the Iranian rocket attacks against Israeli forces, and said we strongly support Israel’s right to defend itself against Iranian aggression.”
The White House has condemned Iran’s attacks on Israeli citizens as “unacceptable and highly dangerous”.
Israel attacked the Iranian targets in Syria in retaliation for 20 rockets being fired at its positions in the Golan Heights.
The strikes killed at least 23 military personnel, including Syrians and non-Syrians, according to the UK-based Syrian Observatory for Human Rights.
The Russian military has claimed that Israel fired more than 70 missiles at Iranian facilities, adding that more than half were shot down by Syrian air defences.
Israel said it had attacked nearly all of Iran’s military infrastructure including weapons storage, logistics sites and intelligence centres.
More from World
Donald Trump and Kim Jong Un to meet in Singapore on 12 June
Dozens killed as Kenya dam bursts, causing ‘huge destruction’
Four new suspected Ebola cases in the Democratic Republic of the Congo
US police officer filmed choking black man outside Waffle House
‘I cry for my children’: Harvey Weinstein’s estranged wife breaks silence
New Zealand glaciers show ‘worst ever’ shrinkage
The exchange of fire came after weeks of rising tensions and followed US President Donald Trump’s decision on Tuesday to withdraw from the landmark 2015 Iran nuclear deal, a move Israel had long advocated.
German Chancellor Angela Merkel and French President Emmanuel Macron have called for a de-escalation in tensions in the Middle East after the attacks.