Britain's ambassador to Iran is flying back to the UK today, days after he was detained and accused of taking part in an illegal protest.
The Foreign Office said the trip was planned a long time ago and was "very much business as usual".
It said he would be going back to Iran "in the coming days" after having a number of meetings.
Rob Macaire was detained on Saturday after going to what Iran said was an illegal protest over the accidental shooting down of a Ukrainian plane that killed 176 people.
The ambassador said he had gone to a candlelight vigil for the victims and left when chanting started. He was taken into custody but later released.
An effigy of him was burned in the streets by pro-regime protesters earlier this week and the country's judiciary called the diplomat an "undesirable element".
Mr Macaire's trip comes as Iran's president said European troops in the Middle East "could be in danger" after the UK, France and Germany challenged the country over its nuclear deal.
President Rouhani, speaking at a cabinet meeting, said: "Today, the American soldier is in danger, tomorrow the European soldier could be in danger."
:: Listen to All Out Politics on Apple Podcasts , Google Podcast s , Spotify , Spreaker
Tensions are high after European nations triggered a dispute mechanism on Tuesday to force Iran into discussions over it nuclear deal, which could mean sanctions are eventually imposed.
The landmark 2015 agreement was designed to stop any effort to build nuclear weapons - something Tehran says it is not pursuing.
Iran said it was ditching the restrictions set out in the deal after the US assassinated its top military leader, Qassem Soleimani, two weeks ago.
President Rouhani did not elaborate on Wednesday's comments.
However, Britain has a military base in Bahrain - a short journey across the Gulf from Iran, while France has a base in Abu Dhabi.
The UK also still has 1,000 soldiers in Afghanistan and about 400 in Iraq.
Meanwhile, the repercussions of the downing of the plane continue in Iran, with reports that a person who filmed one of several videos showing the jet being hit by a missile has been arrested.
Iranian Supreme Leader Ayatollah Ali Khamenei is also set to lead Friday prayers this week for the first time in years amid outrage over the incident.
Officials initially denied it had been shot down, before later admitting it was responsible for the tragedy near the capital, Tehran.
Ukrainian analysts have said they expect to start decoding the "black box" flight data recorders next week, once they get them from Iran.