It was the first missile attack by Iran outside its own territory in 30 years, since the Iran-Iraq war of 1980-88, media in the Islamic republic reported.
"Medium-range missiles were fired from the (western) provinces of Kermanshah and Kurdestan, and a large number of terrorists were killed and weapons destroyed", the statement said.
The Revolutionary Guards are fighting in Syria against militant groups who oppose President Bashar al-Assad.
The Guard warned ISIL militants and their "regional and global supporters" that similar retaliatory attacks would target them as well if another assault in Iran occurred.
More than 20 dead from forest fires in central Portugal
Fire fighting aircraft were being sent from France and Spain , the EU's humanitarian aid commissioner Christos Stylianides said. He said: "This is a region that has had fires because of its forests, but we can not remember a tragedy of these proportions".
"The spilling of any innocent blood will not go unanswered", Press TV cited a statement by the Revolutionary Guards as saying.
Activists in Syria did not immediately have information about the Iranian-claimed strikes.
The Daesh Takfiri terrorist group claimed responsibility for the assaults.
The Islamic State launched two coordinated attacks against Iran's Parliament and tomb of Ayatollah Khomeini on June 7 in Tehran.
Iran has described the attackers as being "long affiliated with the Wahhabi", an ultraconservative form of Sunni Islam practiced in Saudi Arabia.