BEIRUT — Iran fired six medium-range ballistic missiles across Iraq and into Syria early Monday at what it said was an Islamic State base, according to Iranian news agencies, its allies and spokesmen for Iran’s Revolutionary Guards Corps.

The Revolutionary Guards described the strike as retaliation for an attack in Ahvaz, Iran, on Sept. 22 against a military parade by its soldiers in which at least 25 people were killed, including 12 members of the elite unit plus civilian spectators and at least one young child.

Iran initially attributed the attack to an Arab separatist group backed by the United States, Israel, the United Arab Emirates and Saudi Arabia. But the missile strike was on what it said was the headquarters of the Islamic State group in the eastern Euphrates River valley, close to Syria’s border with Iraq. The area is one of the last strongholds of the Islamic State, also called ISIS and Daesh, after its Arabic acronym, and has also been the site of recent American military activity.

It was not immediately clear whether Iran was now blaming the Islamic State exclusively for the attack, a combination of ISIS and the Arab separatist group or, implausibly, those groups and the foreign powers it named previously.