They returned to Iran last July or August under the leadership of a commander with the nom de guerre Abu Aisha, the statement said, and had “intended to carry out terrorist operations in religious cities.”

The statement did not specify whether they were Iranian citizens or provide further information about the female assailant.

But Reza Seifollahi, deputy chief of the Supreme National Security Council, was quoted by the independent newspaper Shargh as saying the men were Iranian.

If true, that would be an unusual acknowledgment, given the antipathy between the Islamic State and Iran. Most of Iran’s 80 million people are Shiites, although sizable Sunni minorities inhabit some border regions and the Islamic State has sought to recruit from among them.

In March, the Islamic State released a video featuring Iranian fighters, in which it called on Sunnis in Iran to form cells and attack Shiite forces, according to the SITE Intelligence Group, which analyzed the video.

Several witnesses to the attacks reported that the assailants had spoken Arabic with an Iranian accent, suggesting that they were ethnic Arabs living in Iran.

In Khuzestan, an oil-rich province that borders Iraq and that is home to many Arabs, both Sunni and Shiite, a video emerged two weeks ago of men in black carrying weapons and shouting slogans on the streets of Ahvaz, the provincial capital. They were arrested the next day, the Intelligence Ministry said.