Iranian media has reported that protests at two British embassy compounds in Tehran has ended.
The protest at the main compound in central Tehran ended after security forces issued the protesters with an ultimatum.
The students' news agency ISNA said protesters had also left a second British embassy compound in north of the capital.
Earlier, Iranian protesters stormed the embassy compounds, smashing windows, hurling petrol bombs and burning the British flag.
Six embassy staff were briefly held hostage by the protesters, before being freed by police.
Several dozen protesters broke away from a crowd of a few hundred outside the main embassy compound in downtown Tehran, scaled the embassy gates and went inside.
Iranian security forces appeared to do little to stop them.
Some protesters chanted "Death to Britain" and demanded the British ambassador leave the country immediately.
The semi-official Mehr news agency said protesters pulled down the British flag, burned it, and put up the Iranian flag.
Inside, the demonstrators threw stones and petrol bombs. One waved a framed picture of Britain's Queen Elizabeth II, state TV showed.
The British Foreign Office said it is outraged by the incursion into its embassy.
Embassy staff fled protesters "by the back door", the Mehr news agency said.
A separate group of protesters broke into a second British embassy compound in the north of the city, the IRNA state news agency said, and seized "classified documents".
Riot police later moved in and mounted the embassy gates, helping protesters climb back before clearing the demonstration.
As part of the sanctions imposed last week, the UK banned all British financial institutions from doing business with their Iranian counterparts, including the Central Bank of Iran.
In London, Foreign Secretary William Hague said Britain expected other countries to follow its lead in imposing financial sanctions on Iran and will take "robust" action if Tehran reduces their diplomatic relations.
Iran subsequently passed a law to expel the ambassador within the next two weeks in retaliation for new British sanctions that cut off all ties with Iran's financial sector.
Britain has threatened to act "robustly" if Iran's foreign ministry follows through by kicking out its ambassador, Dominick Chilcott, who only took up his post last month.
The European Union condemned the attack and called on Iran to protect diplomats on its territory.
A spokeswoman for EU foreign policy chief Catherine Ashton said the attack by protesters on two British diplomatic compounds was a "totally unacceptable incursion".
Iran's foreign ministry said it regretted the storming of the two British diplomatic compounds, the students' news agency ISNA reported, quoting a government statement.
"The foreign ministry regrets the protests that led to some unacceptable behaviours ... We respect and we are committed to international regulations on the immunity and safety of diplomats and diplomatic places," the statement said.