Britain and Iran have agreed to exchange diplomats and begin talks aimed at further improving relations, officials from both countries confirmed on Tuesday.

British Foreign Secretary William Hague said that he and his Iranian counterpart, Javad Zarif, had agreed to appoint non-resident charge d'affaires offices which would discuss the eventual reopening of the British embassy in Iran and the Iranian one in Britain.

Iran's foreign ministry confirmed on Tuesday the diplomatic thaw. "Pursuant to a decision by the Iranian parliament, it was agreed that from today the two countries have a relationship at the level of non-resident charges d'affaires," the ISNA news agency quoted foreign ministry spokeswoman Marzieh Afkham as saying.

The British embassy in Tehran was closed in late 2011 after a mob overran the building as tensions over a possible attack on Iran's nuclear facilities ran high. Iran also closed its embassy in London.

Relations have remained tense since then, but the recent election of Iranian President Hassan Rouhani has raised hopes of a thaw between Iran and the West, and of a possible nuclear deal.

'More positive way'

Hague told lawmakers the coming months "may be unusually significant" in British-Iranian relations. "It is clear that the new president and ministers in Iran are presenting themselves and their country in a much more positive way than in the recent past. There is no doubt that the tone of the meetings with them is different," he told the House of Commons.

But he still expressed caution, saying it was critical for Iran's warmer tone "to be accompanied by concrete actions and viable approach to negotiations."

Iran and Western powers have been arguing for years about Iran's nuclear energy programme.

Iran insists its nuclear facilities are being used for peaceful purposes, but the United States, Europe and Israel call them a cover for the clandestine development of nuclear weapons.

The US and Europe have imposed difficult sanctions on Iran over the programme.