Iran summoned the British ambassador on Sunday after it accused him of "illegal and inappropriate" presence at anti-government demonstrations, deepening a diplomatic rift between the countries.

Ambassador Rob Macaire denounced his detention on Saturday, which he said was "of course illegal", saying he had attended a vigil for victims of the Ukrainian Airlines crash, but left as protests broke out.

It came as Iran faced a second day of protests over the downing of the flight by the Iranian military, killing all 176 passengers, and initial denials by the regime.

Iranian officials defended the detention of Mr Macaire, which foreign secretary Dominic Raab said risked the country gaining "pariah status".

Hamid Baeidinejad, Iran’s ambassador to the UK, suggested Mr Macaire should have heeded his own embassy’s warnings to “not be present in the proximity of political demonstrations in Tehran.”

Iran’s deputy foreign minister, Seyed Abbas Araghchi, said Mr Macaire had been arrested as an “unknown foreigner in an illegal gathering” and “15 min later he was free.”