A man hands a child to a security guard from Iran's parliament building in Tehran after an attack on the complex on Wednesday. Credit:AP Of the 12 victims of the attacks, 11 died at the Parliament building, and one at the mausoleum. In addition, six assailants were killed: four at the Parliament, and two at the mausoleum. Five were men, and one of the mausoleum attackers was a woman. The attacks unfolded over several hours, starting around 10.30am, when men armed with assault rifles and suicide vests - some of them dressed as women - descended on the Parliament building, killing at least one security guard, and wounding and kidnapping other people. The standoff lasted about four hours. The building has been undergoing renovations intended to enhance security, particularly at the entrance, but they have yet to be completed. In a sign that elite security forces had encountered trouble containing the situation, one attacker left the Parliament an hour into the siege, then ran around shooting on Tehran's streets before returning to the building - where at least one of the assailants blew himself up on the fourth floor as others continued firing from the windows.

The body of a terrorist, at background left, lies on the ground while police control the scene at the shrine of late Iranian revolutionary founder Ayatollah Khomeini, just outside Tehran on Wednesday. Credit:AP "I cannot talk, I'm stuck here and the situation is really dangerous, the shooting is continuing, we are surrounded and I cannot talk," an Iranian journalist, Ehsan Bodaghi, said by phone from inside the building during the standoff, before the call was disconnected. Yelling and screaming could be heard in the background. Mohammad Ali Saki, editor of The Tehran Times, said in a phone interview that the four assailants at the Parliament building had "targeted guards, cleaners, employees of the administrative and finance sections," but had "never got near the Parliament chamber itself." Police officers run to take position around Iran's parliament building following an assault by several attackers on Wednesday. Credit:Ali Khara The assailants were armed with AK-47s and hand grenades and wore what appeared to be explosive vests, he said.

The Islamic State released a graphic 24-minute video showing a bloodied man lying on the ground in Parliament while a gunman in the background shouted in Arabic, "Thank God! Do you think that we are going to leave? We will remain here, God willing." Then Iranian leader Ayatollah Ruhollah Khomeini greets well-wishers before casting his vote in 1988. Credit:AP/File The assault on the mausoleum - about 16 kilometres south of Parliament - began shortly before 11am and lasted for about an hour and a half, state news media reported. The attacks, the first in Tehran in more than a decade, came just over two weeks after Mr Trump, with Saudi Arabia and its allies, vowed to isolate Iran. Iran has dismissed those remarks, made at a summit meeting in Riyadh, the Saudi capital, as a scheme by Mr Trump to sell weapons to Saudi Arabia. In the view of many in Iran, the Islamic State, also known as ISIS or ISIL, is inextricably linked to Saudi Arabia. "ISIS ideologically, financially and logistically is fully supported and sponsored by Saudi Arabia - they are one and the same," said Hamidreza Taraghi, a hard-line analyst.

Iran and Saudi Arabia are the leading nations on opposing sides of the Middle East split between Shiite and Sunni Islam. Iran has military advisers in Iraq and Syria, and it controls and finances militias in those countries and in Lebanon. Tehran also has some influence over the Houthis fighting the government in Yemen, and it often speaks out in support of Shiites in Bahrain, a majority group that Iran says is repressed by the Sunni monarchy. King Salman of Saudi Arabia has accused Iran of "spearheading global terrorism." Saudi officials say Iran is plotting to control the region. Saudi Arabia, an autocratic kingdom, also opposes Iran's political ideology, which has a clerical supreme leader but also a president, Parliament and city councils, chosen in elections in which both men and women can participate. On Wednesday morning, only hours before the attacks in Iran, the Saudi foreign minister, Adel al-Jubeir, said that Iran must be punished for its interference in the region and called Tehran the world's leading supporter of terrorism. Iran, in turn, has long accused Saudi Arabia of backing terrorists in the region, saying that the kingdom had facilitated the rise of Sunni extremist groups such as the Islamic State and others in Iraq and Syria. After Egypt, Saudi Arabia, the United Arab Emirates and other states cut ties with the gas-rich kingdom of Qatar on Monday, citing its support for Iran, Tehran rushed to fill the void, offering to send food and medicine.

One Iranian security official said the attacks had been a message from Saudi Arabia that was meant to teach Iran a lesson. He also said the assaults were intended to test Iran's reaction. Others questioned Tehran's decision to rise to the defense of Qatar. "We are wrong to suddenly seek close ties with Qatar," said Saeed Laylaz, an economist close to the government. "They have been bankrolling the Sunni terrorist groups, in the same way the Saudis have." Raz Zimmt, a scholar at the Institute for National Security Studies at Tel Aviv University who specialises in Iranian affairs, said the attacks were unprecedented in that they had occurred in the heart of Tehran. "I have no doubt that the Iranian regime is going to blame ISIS and Saudi Arabia, since that serves the official Iranian position," he said in an interview on Israeli radio. "We've heard for the past two years, more or less, that if the Revolutionary Guards stop operating in Syria and Iraq, the terrorists are going to make their way into Iran. As far as they're concerned, it doesn't matter if it was ISIS or wasn't." While terrorist attacks have become relatively commonplace in Europe and in most of the Middle East, Iran had remained comparatively safe. During May's election campaign, President Hassan Rouhani often pointed to that fact, lauding the country's security forces and intelligence agencies for their vigilance.

The coordinated terrorist attacks on Wednesday brought such feelings of security to an end, one analyst said. "Today, it was proved that we are vulnerable too," the analyst, Nader Karimi Joni, said. "We must anticipate more attacks by the Islamic State, now that we are defeating them in Iraq and Syria," he added. Terrorism in Iran has been relatively rare, though for many years, the country suffered from a long and bitter campaign of attacks by an armed opposition group, Mujahedeen-e-Khalq, a Marxist-Islamic organisation that for decades was supported by the former Iraqi dictator, Saddam Hussein. In many of Mujahedeen-e-Khalq's attacks, its members would take cyanide when cornered. In 2012, the group was taken off the United States' list of terrorist organisations with the support of conservative Republican politicians. The attacks in Iran came as the Islamic State faces increasing pressure on the battlefield. The territory of the Islamic State's self-declared caliphate in Iraq and Syria is shrinking. US-backed forces in Syria began major operations on Monday to seize Raqqa, the Islamic State's de facto capital. Many Islamic State fighters have been decamping to the Syrian city of Mayadeen further south. In Iraq, fierce fighting is underway for the city of Mosul, with Iranian-backed militias and US warplanes aiding the Iraqi military. A common Islamic State tactic, when it loses territory, is to create a distraction and to try to bolster morale among its followers by staging attacks abroad. The suicide bombing in Manchester, England, on May 22, and the terrorist attack on London on Saturday night fit that pattern. New York Times