By Guy Faulconbridge

TEHRAN (Reuters) - Britain reopened its embassy in Tehran on Sunday, a striking signal of how Western ties with Iran have thawed since protesters stormed the compound nearly four years ago.

Foreign Secretary Philip Hammond watched the British flag being raised in the garden of the opulent 19th century building while the national anthem played. In 2011, the attackers burned the Union Jack and ransacked the ambassador's residence.

"Today's ceremony marks the end of one phase in the relationship between our two countries and the start of a new one - one that I believe offers the promise of better," he said.

After what was a low point in diplomacy between the two countries, he said, the relationship had improved "step by step" since the election of Iranian President Hassan Rouhani in 2013.

Hammond said the nuclear deal that the Islamic Republic struck with six major world powers last month was also an important milestone.

The agreement prompted a flurry of European visits - including from German and French ministers - aimed at positioning for the end of Iran's long economic isolation.

Britain had been held back by security concerns after the storming of its two main diplomatic compounds in Tehran on Nov. 29, 2011. The protesters slashed portraits of British monarchs, torched a car and stole electronic equipment.

Graffiti reading "Death to England" still adorns the doors to a grand reception room in a reminder of the storming.

Prime Minister David Cameron called the attack a 'disgrace', closed Britain's embassy and expelled Iran's diplomats from London.

On Sunday a small group of protesters reportedly gathered near the newly reopened Tehran embassy, which was guarded by dozens of Iranian security forces.

The hardline Fars news site showed pictures of female protesters in black chadors and a journalist from the local Shargh newspaper tweeted that the crowd chanted “Death to England” before security forces dispersed it.

Story continues

A few hours after the Tehran ceremony, Iran re-opened its embassy in London; both will be run by chargé d'affaires at first with ambassadors to be agreed within months, Hammond said.

He is only the second British foreign minister to visit Iran since the 1979 Islamic revolution that toppled the U.S.-backed shah. The last visit was by Jack Straw in 2003.

Accompanying Hammond was a small group of business leaders, including representatives from Royal Dutch Shell, Energy and mining services company Amec Foster Wheeler and Scottish industrial engineering firm Weir Group.

"RETURN OF THE FOX"?

After more than a decade of casting the Islamic Republic as a rogue power seeking to sow turmoil through the Middle East, Britain has sought to improve ties with Iran, whose proven natural gas reserves are as vast as Russia's.

"In the first instance, we will want to ensure that the nuclear agreement is a success, including by encouraging trade and investment once sanctions are lifted," Hammond said.

Under the nuclear deal, sanctions imposed by the United States, European Union and United Nations will be lifted in exchange for Iran agreeing long-term curbs on a nuclear programme the West suspected was intended to make a nuclear bomb. Tehran has always denied seeking nuclear arms.

Hammond told Iran's central bank governor, Valiollah Seif, that British banks, mindful of penalties imposed in the past by U.S. authorities, wanted to ensure that they were fully compliant when they return to Iran.

"There is a huge appetite both on the part of our commercial and industrial businesses to engage with the opportunity of Iran opening up and there is huge appetite on the part of our financial institutions to support that activity," he said.

"But of course it has to be done in the proper way."

Seif said the countries had had positive ties in the past and could build on them.

While the nuclear deal is seen as a major opportunity by some, including U.S. President Barack Obama, hardliners in Washington and Tehran have opposed it, as has Israel.

Britain has been cast for decades by opponents inside Iran as a perfidious "Old Fox" or "Little Satan" who does the bidding of "Big Satan," the United States.

An electronic newsletter of the Fars news agency cast the reported re-opening of the embassy as the "Return of the Fox".

"EVIL EMBASSY"

Following the 2011 storming, which was a protest against nuclear-related sanctions imposed by London, Iranian Supreme Leader Ayatollah Ali Khamenei called it an "evil embassy".

A portrait of Queen Victoria was torn in two, the head was cut out of a portrait of Edward VII and a picture of Queen Elizabeth was stolen.

Protesters also smashed the large stone lion and unicorn on the gates at the ambassadorial residence, where in 1943 a dinner was held for Winston Churchill, Joseph Stalin and Franklin D. Roosevelt during the first meeting between the leaders of Britain, Russia and the United States to discuss their strategy for winning World War Two.

There has been no U.S. embassy in Tehran since it was sacked in the early days of the Islamic Revolution in 1979 by students who feared a repeat of a 1953 coup when the CIA orchestrated the overthrow of Prime Minister Mohammad Mossadegh.

The U.S. hostage crisis lasted 444 days and Washington and Tehran have never resumed diplomatic relations, leaving Britain first in line for the anti-Western feelings of the hardliners who run the Islamic Republic and their supporters.

Iran's Foreign Minister Javad Zarif said it was too early to talk of reopening the U.S. embassy, accusing Washington of having an "illogical attitude" towards Iran.

(Additional reporting by Paul Sandle and Peter Nicholls in London and Babak Dehghanpisheh in Beirut; editing by Jon Boyle and Philippa Fletcher)