Media captionJeremy Bowen reports on the thawing of relations between the UK and Iran

The British embassy in Iran has reopened, nearly four years after it was closed.

Foreign Secretary Philip Hammond attended a ceremony in Tehran with Iranian diplomats to mark the reopening while Iran has also reopened its embassy in London.

The UK embassy was closed in 2011 after it was stormed by protesters during a demonstration against sanctions.

Mr Hammond is the first UK foreign secretary to visit Iran since 2003.

The reopening comes weeks after Iran reached a deal with six world powers aimed at curbing its nuclear programme.

'Important milestones'

At the ceremony Mr Hammond said the attack in 2011 had been "a low point" but since the election of President Hassan Rouhani things had "steadily improved, step by step".

Image caption
Mr Hammond said it was a historic moment in UK-Iran relations

He said: "Last month's historic nuclear agreement was another milestone, and showed the power of diplomacy, conducted in an atmosphere of mutual respect, to solve shared challenges.

"Re-opening the embassy is the logical next step. To build confidence and trust between two great nations.

"Iran is, and will remain, an important country in a strategically important but volatile region. Maintaining dialogue around the world, even under difficult conditions, is critical."

Earlier Mr Hammond told the BBC there was a "big deficit of trust" with Iran, and "major issues on which we have fundamental differences of view".

"But the symbolic importance of deciding to reopen embassies in each other's countries, is that we have chosen to talk to each other about those differences... to look for areas where our interests do align," he said.

Image copyrightAFP / GettyImage caption
The British embassy in Tehran, seen here in 2003, has been closed since 2011

Initially, the embassy will be headed by a charge d'affaires, Ajay Sharma, but Mr Hammond said an agreement on upgrading to full ambassador status is expected to be reached in the coming months.

A trade delegation has also travelled to Tehran with Mr Hammond and the Exchequer Secretary to the Treasury Damian Hinds to discuss possible future trade opportunities.

Mr Hammond said there was "huge appetite" from UK businesses interested in investing in Iran and creating conditions for British banks to be able to finance trade deals with the country.

In London, former Foreign Secretary Jack Straw attended the opening of the Iranian embassy in South Kensington.

The UK responded by closing the Iranian embassy in London later that month.

Image copyrightAFPImage caption
The British embassy in Tehran was stormed by protestors in 2011

But following the election of Hassan Rouhani and an agreement on how to deal with Iran's nuclear programme, the then Foreign Secretary William Hague proposed the reopening of the embassy in June last year.

Since then, the reopening of the embassy has been held up by technical problems over visa policy and communications equipment, Mr Hammond has said.

Inside the embassy

Image copyrightReuters

By BBC Middle East editor Jeremy Bowen in Tehran

As he declared the embassy open, Britain's foreign secretary Philip Hammond said there were no limits to what Britain and Iran might achieve together over time, though they wouldn't always agree.

A small group of Iranians who work at the embassy watched as the Union flag was hoisted in the 14 and a half acre embassy compound for the first time since 2011.

Behind the high walls there are gracious lawns and dappled pools of shade from mature trees. It's all a remarkable contrast with the traffic and noise outside, in a scruffy part of inner city Tehran.

But for many Iranians, the compound with the lion and unicorn on the pillars of the gate is also a symbol of Britain's past meddling in their country. As a precaution, riot police were lined up outside the gate.

Inside the embassy, graffiti left by radicals who invaded it in 2011 is still on doors and panelling. Above a portrait of the Queen is the message 'Death to England'.