The UK's ambassador to Iran, Rob Macaire, is returning to London for talks following his arrest by the Tehran authorities.

His visit comes amid heightened tensions between Iranian authorities and the UK after Iran’s judiciary labelled the ambassador “persona non grata” and called for his expulsion from the country.

However, the Foreign Office has said Mr Macaire's visit "has been planned for quite a while" and insisted he intends to return to Tehran in the coming days.

"It is quite normal for our ambassadors to come back to London to have meetings here," a Foreign Office spokesperson said.

Mr Macaire was arrested in Tehran on Saturday over his attendance at a vigil for the 176 people, including four Britons, who were killed when Iran accidentally shot down a Ukrainian jet.

Protests in Iran over downing of plane and tensions with the west Show all 23 1 /23 Protests in Iran over downing of plane and tensions with the west Protests in Iran over downing of plane and tensions with the west Anti-government protest at Amirkabir University Iranian police officers take position while protesters gather in front of Amir Kabir University AP Protests in Iran over downing of plane and tensions with the west Anti-government protest at Amirkabir University Iranians demonstrate following a tribute for the victims of the Ukraine Boeing 737 crash in front of the Amirkabir University in the capital Tehran EPA Protests in Iran over downing of plane and tensions with the west Anti-government protest at Amirkabir University Iranian police dispersed students chanting "radical" slogans during a gathering in Tehran to honour the 176 people killed when an airliner was mistakenly shot down AFP via Getty Protests in Iran over downing of plane and tensions with the west Anti-government protest at Amirkabir University - People hold flowers as tear gas fired by police rises Online videos purported to show that Iranian security forces fired both live ammunition and tear gas to disperse demonstrators protesting against the Islamic Republic's initial denial that it shot down a Ukrainian jetliner AP Protests in Iran over downing of plane and tensions with the west Anti-government protest at Amirkabir University Iranian police officers take position while protesters gather AP Protests in Iran over downing of plane and tensions with the west Anti-government protest at Amirkabir University AFP correspondents said hundreds of students had gathered early in the evening to pay respects to those killed in the air disaster ISNA/AFP via Getty Protests in Iran over downing of plane and tensions with the west Anti-government protest at Amirkabir University Iranian protester prepares to throw a tear gas canister back at police AP Protests in Iran over downing of plane and tensions with the west Anti-government protest at Amirkabir University A protester confronts an Iranian police officer AP Protests in Iran over downing of plane and tensions with the west Anti-government protest at Amirkabir University epa08120223 Iranians protest to show their sympathy with victims of Ukraine International Airlines Boeing 737-800 in front of the Amir Kabir University in Tehran, Iran, 11 January 2020. Media reported that hundreds of Iranians protests in Tehran in solidarity with victims of the Ukraine plane as Iranian military released a statement claiming that Ukraine International Airlines flight PS752 was shot down due to human error. EPA/ABEDIN TAHERKENAREH ABEDIN TAHERKENAREH EPA Protests in Iran over downing of plane and tensions with the west Anti-government protest at Amirkabir University Iranian police officers take position while protesters gathe AP Protests in Iran over downing of plane and tensions with the west Anti-government protest at Amirkabir University Iranians light candles for victims EPA Protests in Iran over downing of plane and tensions with the west Anti-government protest at Amirkabir University epa08120526 Iranians protest to show their sympathy to victims of Ukraine International Airlines Boeing 737-800 in front of the Amir Kabir University in Tehran, Iran, 11 January 2020. The Iranian military released a statement on 11 January 2020 that Ukraine International Airlines flight PS752 was shot down due to 'human error.' The passemger jet en route from Tehran to Kiev crashed minutes after takeoff on 08 January 2020, all all 167 passengers and nine crew members aboard were killed. EPA/ABEDIN TAHERKENAREH ABEDIN TAHERKENAREH EPA Protests in Iran over downing of plane and tensions with the west British embassy protest in Tehran People burn British and Israeli flags during a protest in front of the British embassy, in Tehran. Hundreds of Iranian hardliners gathered for a protest against Britain, a day after the UK ambassador to Iran Robert Macaire was detained after attending a a vigil for the victims of Ukraine passenger jet EPA Protests in Iran over downing of plane and tensions with the west British embassy protestBritish embassy protest in Tehran Chanting "Death to Britain", up to 200 protesters rallied outside the mission a day after the brief arrest of British ambassador Rob Macaire AFP via Getty Protests in Iran over downing of plane and tensions with the west British embassy protest in Tehran epa08122502 Iranian hardliners shout slogans as they gather in front of the British embassy during an anti-Britain protest, in Tehran, Iran, 12 January 2020. According to reports, hundreds of Iranian hardliners gathered for a protest against Britain, a day after the UK ambassador to Iran Robert Macaire was detained after attending a a vigil for the victims of Ukraine passenger jet. EPA/ABEDIN TAHERKENAREH ABEDIN TAHERKENAREH EPA Protests in Iran over downing of plane and tensions with the west British embassy protest in Tehran Iranian demonstrators hold placards bearing the images of slain military commander Qasem Soleimani and Iran's Supreme Leader Ayatollah Ali Khamenei in front of the British embassy in the capital Tehran on January 12, 2020 following the British ambassador's arrest for allegedly attending an illegal demonstration. - Chanting "Death to Britain", up to 200 protesters rallied outside the mission a day after the brief arrest of British ambassador Rob Macaire at a memorial for those killed when a Ukraine airliner was shot down. (Photo by ATTA KENARE / AFP) (Photo by ATTA KENARE/AFP via Getty Images) ATTA KENARE AFP via Getty Images Protests in Iran over downing of plane and tensions with the west Protesters chant slogans and hold up posters of Gen. Qassem Soleimani while burning representations of British and Israeli flags, during a demonstration in front of the British Embassy in Tehran, Iran, Sunday, Jan. 12, 2020. A candlelight ceremony late Saturday in Tehran turned into a protest, with hundreds of people chanting against the country's leaders â€” including Supreme Leader Ayatollah Ali Khamenei â€” and police dispersing them with tear gas. Police briefly detained the British ambassador to Iran, Rob Macaire, who said he went to the Saturday vigil without knowing it would turn into a protest. (AP Photo/Ebrahim Noroozi) Ebrahim Noroozi AP Protests in Iran over downing of plane and tensions with the west British embassy protest in Tehran epa08122741 Iranian hardliners gather in front of the British embassy during an anti-Britain protest, in Tehran, Iran, 12 January 2020. According to reports, hundreds of Iranian hardliners gathered for a protest against Britain, a day after the UK ambassador to Iran Robert Macaire was detained after attending a a vigil for the victims of Ukraine passenger jet. EPA/ABEDIN TAHERKENAREH ABEDIN TAHERKENAREH EPA Protests in Iran over downing of plane and tensions with the west A hardline protester holds up a placard during a demonstration in front of the British Embassy in Tehran, Iran, Sunday, Jan. 12, 2020. A candlelight ceremony late Saturday in Tehran turned into a protest, with hundreds of people chanting against the country's leaders â€” including Supreme Leader Ayatollah Ali Khamenei â€” and police dispersing them with tear gas. Police briefly detained the British ambassador to Iran, Rob Macaire, who said he went to the Saturday vigil without knowing it would turn into a protest. (AP Photo/Ebrahim Noroozi) Ebrahim Noroozi AP Protests in Iran over downing of plane and tensions with the west British embassy protest in Tehran epa08122743 Iranian hardliners gather in front of the British embassy during an anti-Britain protest, in Tehran, Iran, 12 January 2020. According to reports, hundreds of Iranian hardliners gathered for a protest against Britain, a day after the UK ambassador to Iran Robert Macaire was detained after attending a a vigil for the victims of Ukraine passenger jet. EPA/ABEDIN TAHERKENAREH ABEDIN TAHERKENAREH EPA Protests in Iran over downing of plane and tensions with the west British embassy protest in Tehran epa08122745 Iranian hardliners gather in front of the British embassy during an anti-Britain protest, in Tehran, Iran, 12 January 2020. According to reports, hundreds of Iranian hardliners gathered for a protest against Britain, a day after the UK ambassador to Iran Robert Macaire was detained after attending a a vigil for the victims of Ukraine passenger jet. EPA/ABEDIN TAHERKENAREH ABEDIN TAHERKENAREH EPA Protests in Iran over downing of plane and tensions with the west British embassy protest in Tehran epa08122786 Iranian hardliners gather in front of the British embassy during an anti-Britain protest, in Tehran, Iran, 12 January 2020. According to reports, hundreds of Iranian hardliners gathered for a protest against Britain, a day after the UK ambassador to Iran Robert Macaire was detained after attending a a vigil for the victims of Ukraine passenger jet. EPA/ABEDIN TAHERKENAREH ABEDIN TAHERKENAREH EPA Protests in Iran over downing of plane and tensions with the west Protesters chant slogans while holding up posters of Gen. Qassem Soleimani during a demonstration in front of the British Embassy in Tehran, Iran, Sunday, Jan. 12, 2020. AP

Iranian protesters on Tuesday burned an effigy of the ambassador alongside UK and US flags at a demonstration by members of the Basij, a militia which is part of the Islamic Revolutionary Guard Corps (IRGC).

Mr Macaire angered Iranian authorities over the weekend by attending a vigil for the crash victims, in which demonstrators condemned the downing of the Ukrainian airliner.

The UK ambassador has said he left the event after protests broke out, but Iran’s foreign ministry summoned him on Sunday to explain his “illegal and inappropriate presence” at the event.

Iran admitted last week that it shot down the Ukrainian passenger jet, killing all 176 people on board, but said the incident occurred by accident as the result of human error.

Authorities had initially denied involvement in the crash, which happened shortly after Iran responded to the US killing of general Qassem Soleimani by launching ballistic missiles at two bases in Iraq which house US troops.

An official from the IRGC said a “bad decision” to open fire on the plane had been made after forces mistook it for a cruise missile.

Dominic Raab, the UK foreign secretary, has condemned Mr Macaire’s arrest as “a flagrant violation of international law” and said he has received no formal indication that the ambassador will be expelled.

“It would be deeply regrettable if that were the case,” he told the House of Commons.

“We need to keep the diplomatic channels open, and futile gestures like that are not going to resolve the problems that the regime in Tehran face.”