Iran has launched strikes against targets in three allied countries - Syria, Iraq and Pakistan - in two days. Pakistan responded with a missile attack on Iranian territory. So why did Iran do it, and why did it happen now?
Everything suggests Iran's military, the Revolutionary Guards, were under pressure to act from Islamic hardliners inside the country.
These hardliners are increasingly unhappy with Iran apparently standing by as Israel kills huge numbers of Palestinians in Gaza.
They are also angry that Iran did nothing after its arch-enemy Israel assassinated a number of top Revolutionary Guard commanders in Syria - and only verbally supported the Houthis when they came under US-UK strikes.
And then there's the bomb attack claimed by the Islamic State group (IS) in the Iranian city of Kerman two weeks ago, which killed at least 84 people.
The Guards felt they had to act somehow, without ratcheting up tensions with Israel or the US. Iran has been careful not to get directly involved in the Israel-Gaza war - though it does offer military support to Hamas, the Houthis and Hezbollah.
But in striking Syria, Iraq and Pakistan, they appear to have have scored a few own goals.
Iran said the missile and drone attack inside Pakistan targeted militant group Jaish al-Adli - what it calls an "Iranian terrorist group". But Pakistan says it killed two children.
Pakistan, a nuclear power, felt it had to respond to the strike - which was a clear violation of Pakistani sovereignty and territorial integrity. It also undermined Pakistan's nuclear deterrence.
So it launched attacks of its own against what it said were hideouts of Pakistani "terrorists" based in Iran - the Balochistan Liberation Army and the Balochistan Liberation Front. Iran says three women, two men and four children were killed.
The tit-for-tat attacks have left the normally good relations between the neighbours seriously damaged. The Revolutionary Guard did not anticipate this reaction from Pakistan.
Iran and Pakistan share a 900km (560 mile) border which is difficult for either to control without cooperation. Pakistan has been a valuable ally in international forums, often voting in favour of Tehran.
The attack on Syria appears to have been in response to the killings in Kerman. But even there, there are no reports of a big hit against IS or hardline Sunni groups, as Iran claims.
In Iraq - perhaps Iran's closest neighbour and ally - the government is infuriated by attacks where Iran used some 11 ballistic missiles to hit a target in Irbil, in the Iraqi region of Kurdistan.
Iran claimed it had targeted an operations centre of Mossad, the Israeli intelligence agency. But Iraqi and Kurdish authorities say the house of a well-known businessman was hit, killing him along with his wife and two children, one of whom was under one year old.
Iraq's government has complained to the UN Security Council, which is due to discuss the attacks. The incident has eroded neighbourly relations cultivated over years, in spite of several issues between the two nations.
The Revolutionary Guards may have taken the decision to launch the attacks against the three countries after only consulting Iran's supreme leader. There are signs the foreign minister was not consulted before the attacks were launched.
The attacks this week appear to have undermined Iran's international position further, putting its defences at risk and making the Revolutionary Guard look reckless and prone to taking uncalculated risks.