At least five of the armed men who killed 17 people and injured 45 in unprecedented terror attacks in Tehran were fully fledged members of Isis who fought for the group in Syria and Iraq, the Iranian authorities have confirmed.

“They earlier left Iran and were involved in the crimes of the terrorist group in Raqqa and Mosul,” the intelligence ministry said in a statement, referring to Isis’s effective capitals in the two countries.

“Last year, they returned to Iran ... to carry out terrorist attacks in the holy cities of Iran,” the statement carried by the state news agency said.

Wednesday’s dual attacks on the parliament building and Ayatollah Khomeini’s tomb in the Iranian capital were the first terror incidents on Iranian soil claimed by Isis.

The extremist Sunni group views the Shia-ruled country, and most of its inhabitants, as heretical. While it has long called for attacks in Iran, in recent months Isis propaganda has been released in Farsi with the aim of recruiting the country’s Sunni minority.

The south-west of Iran has seen some bombings and unrest due to a Sunni secessionist insurgency, but no major terror incidents have occurred in the country for several years

Inside Iran: What life is really like in Tehran Show all 2 1 /2 Inside Iran: What life is really like in Tehran Inside Iran: What life is really like in Tehran An anti-US mural near the former US embassy in Tehran, November 2007 EPA Inside Iran: What life is really like in Tehran Marriage of convenience: Pre-marital sex is taboo in Iran - though 55 per cent of young men and women admit to having a boyfriend or girlfriend EPA

Iran is one of the world powers engaged in the ground war against Isis, funding troops and firepower in order to assist the government of Bashar al-Assad in Syria and Shia militias in the Iraqi coalition battle for Mosul.

That Wednesday’s attackers were able to travel to the so-called caliphate and back without alerting Iran’s watchful security services has troubled many in the country.

The incidents took place less than a month after moderate President Hassan Rouhani was re-elected.

“The atmosphere is tense. It is a blow to Rouhani. How can four armed men enter the parliament, where a very tight security has always been in place,” a senior official, who asked not to be named, told Reuters.

The assaults could also have ramifications across the region.

Gunfire heard outside Iran parliament as battle continues

Iran’s powerful religious Revolutionary Guards blamed rival Sunni-led Saudi Arabia for the attacks, an accusation the kingdom’s foreign minister dismissed.

“An attack like this could provoke disproportionate counter-terror response in Iran.

“Iranian officials will be called on to step up intervention in Iraq-Syria big time. If this happens, a more intense ‘Sunni war against Shia Islam’ will pour petrol on [Isis’s] ideological fire,” said Charlie Winter, a research fellow at the International Centre for the Study of Radicalisation (ICSR) at King’s College London.