The shooting attack on the British embassy in Tehran came against the background of a deepening diplomatic crisis between the two countries.
The arrest in the UK last month of a former Iranian ambassador, Hadi Soleimanpour, on an extradition warrant from Argentina, has brought relations close to the brink of rupture.
It has also exacerbated anti-British sentiment, especially in militant hard-line right-wing circles, which have been baying for the expulsion of the British ambassador in Iran.
But the attack certainly did not reflect Iranian government policy, and may well have come as an embarrassment to officialdom in Tehran.
The attack has embarrassed the authorities
The Iranian Foreign Ministry spokesman, Hamid-Reza Asefi, described the shooting as "irresponsible". He said the attack was being "seriously investigated" and that that security and surveillance had been stepped up around the embassy's sprawling compound in central Tehran.
The incident came only hours after the Iranian ambassador in London, Mortaza Sarmadi, had returned to Tehran for consultation over the Soleimanpour crisis.
His counterpart in Tehran, Richard Dalton, who broke off his summer holiday to return to his post last week, was also called in to the Iranian foreign ministry on Tuesday night to hear further remonstrations from senior Iranian diplomats.
21 August: Hade Soleimanpour arrested in northern England, following a request from Argentina
24 August: Iran protests at the arrest and demands an apology
27 August: Iranian deputy foreign minister travels to London, but UK says Mr Soleimanpour's fate is a matter for the courts
3 September: Iran recalls its ambassador 'for consultations'
Hadi Soleimanpour is sought by Buenos Aires on a warrant alleging complicity in the 1994 bombing of a Jewish centre there, in which more than 80 people died. He was ambassador there at the time. He and Iran strongly deny any involvement.
British diplomats - and Foreign Secretary Jack Straw - have tried hard to convince Tehran that the case is purely judicial and not political. Tehran remains unpersuaded, at least in public statements.
There has been strong speculation - amounting to expectation - in Tehran that the Iranian side would respond by expelling Ambassador Dalton.
Even the normally mild-mannered President, Mohammad Khatami, warned that there would be "harsh measures" unless Hadi Soleimanpour was released immediately with an apology.
But so far, the Iranians have held back from any such step, amidst what one diplomat described as "an eerie silence".
An obviously appropriate moment was missed last Friday, when the Bow Street Court in London turned down bail for Hadi Soleimanpour for the second time despite an offer from the embassy and relatives to lodge more than £700,000 ($1.1m).
One obvious reason for Tehran's reluctance to take strong action is that the reformists who run its foreign ministry know that the Blair government - and Jack Straw - have invested much effort and political capital in improving ties with Iran. Mr Straw has made four official visits to Tehran, despite Britain's close bond with Iran's "Great Satan" adversary the United States.
Mr Soleimanpour's treatment (R) has strained ties
Britain is also a key European player and there is a strong likelihood that the expulsion of its ambassador would lead to the withdrawal of all the European Union envoys, as happened with Iran's diplomatic crisis with Germany in the 1990s.
Even Iranian hard-liners favour better relations with the EU as a counterbalance to the United Sates.
There are wider considerations too. Iran is currently under huge international pressure on a number of issues, most urgently allegations by the US that it has been secretly pursuing the development of nuclear weapons.
The international nuclear inspectorate, the IAEA, is to meet in Vienna next week to hear a report from its Director-General, Mohamed ElBaradei, expressing concern about possible uranium enrichment activities and other irregularities by Iran.
Iranians have called for the expulsion of the UK ambassador
Tehran is being pressed to sign an Additional Protocol that would allow the kind of snap IAEA inspections that alone would enable the Agency to certify a clean bill of nuclear health for the Islamic Republic.
The European Union has said it will review its own relations with Tehran at the end of September in the light of Tehran's behaviour. That could mean calling off negotiations for a Trade and Co-operation Agreement that have been under way since last year.
In such a climate, expelling the UK ambassador is clearly not a step to be taken lightly.
The shooting attack on the embassy may ironically have further complicated the situation and delayed a decision by Tehran on how to react diplomatically on the Soleimanpour case.