Foreign Secretary Dominic Raab has condemned the arrest of the UK ambassador to Iran as a “flagrant violation of international law”.
Rob Macaire was detained after attending a vigil for those who died when a passenger plane was shot down on Wednesday.
He left when it turned into a protest before being arrested and accused of helping to organise the demonstrations.
Under the Vienna Convention, diplomats cannot be detained.
The Foreign Office is to demand a full explanation.
Mr Macaire was arrested and held for three hours when he stopped at a barber shop for a haircut on his way back to the UK embassy.
In a statement, Mr Raab said: “The arrest of our Ambassador in Tehran without grounds or explanation is a flagrant violation of international law.
“The Iranian government is at a cross-roads moment. It can continue its march towards pariah status with all the political and economic isolation that entails, or take steps to deescalate tensions and engage in a diplomatic path forwards.”
The Iranian Etemad newspaper shared a picture of the ambassador on Twitter after the Tasnim news agency reported his arrest.
Iranian media claimed Mr Macaire was accused of inciting anti-government protests.
Iran has said Ukraine International Airlines flight PS752 was shot down due to “human error” and there were demonstrations in Tehran and other cities on Saturday as people gathered to commemorate those who died.
Earlier, the UK prime minister said Iran’s admission was an “important first step” and called for an investigation into the “tragic accident”.