LONDON — Underscoring its warming relations with Iran, Britain announced Tuesday that the “circumstances are right” to reopen the British Embassy in Tehran and that it would establish a small presence there as soon as possible.

Full diplomatic ties were suspended in 2011 after attacks on Britain’s diplomatic compound in Tehran, but relations have been improving ever since a change in political leadership in Iran last year and progress in international talks on Iran’s nuclear program.

The pace of the thaw appears to have been intensified by a shared interest in containing Sunni militants after their recent military successes in Iraq. On Monday, the office of Prime Minister David Cameron said that Foreign Secretary William Hague had spoken about the crisis in Iraq to his Iranian counterpart, Mohammad Javad Zarif, over the weekend.