Tuesday’s attack, which followed Britain’s decision to impose further sanctions on Iran over its nuclear programme, has forced foreign secretary William Hague to close the Iranian embassy in London. Hague has demanded its staff to leave within the next 48 hours.

“If any country makes it impossible for us to operate on their soil they cannot expect to have a functioning embassy here,” Mr Hague told MPs.

He said there had been “some degree of regime consent” in the attacks on the embassy and on another UK diplomatic compound in Tehran.

British diplomatic staff in Tehran have been evacuated from the embassy under siege.

Britain’s decision over the sanctions on Iran resulted in the Iranian government reducing its diplomatic ties with the UK.

Hague said relations between the UK and Iran were now at their lowest level, but the UK was not severing relations with Tehran entirely.

Hague told parliament he would raise the matter at a meeting of the EU Foreign Affairs Council in Brussels.

We will discuss these events and further action which needs to be taken in the light of Iran’s continued pursuit of a nuclear weapons programme,” he said.

Also on Wednesday, Germany announced it was temporarily recalling its ambassador to Tehran over the “unacceptable” storming of the British embassy. The US, EU and UN Security Council also condemned the attacks.

On Tuesday, hundreds of students protesters scaled the walls and the gates of the British embassy in Tehran, burning British flags and a car.

The private quarters of staff and the ambassador had been ransacked, the main embassy office set on fire and personal possessions belonging to UK diplomats stolen.

Another UK diplomatic compound in northern Tehran, known locally as Qolhak Garden, was also overrun and damaged.

Iran said it regretted the incident, which it described as “unacceptable behaviour by a small number of protesters”.

Hague said the majority of those taking part had been members of a regime-backed Basij militia group.

Iran was subject to sanctions from the US, Canada and the UK last week – including measures to restrict the activities of the Iranian central bank.

It followed a report by the UN’s nuclear watchdog (IAEA) that said Iran had carried out tests “relevant to the development of a nuclear device”.

Iran denies the accusations, saying its nuclear programme is solely for peaceful purposes.