The British government closed its embassy in Iran today and began deporting from Britain Iranian students convicted of participating in a violent demonstration outside the American Embassy here a month ago.

British Home Secretary William Whitelaw deported the first three of 44 convicted Iranian demonstrators. Their deportation had been recommended by magistrates who heard their cases in London courts. Two of them were put on an Iran Air flight to Tehran this afternoon.

Earlier today four of the five remaining British diplomats in Tehran left for London because of Iranian threats of relaliation for the arrest, jailing and expected deportation of the Iranian students who clashed with London police at the American Embassy here. The British Embassy consul will remain in Tehran to look after British interests from the Swedish Embassy.

Emphasizing that Britain was not formally breaking diplomatic relations with Iran and hoped to reopen its embassy in the future, the British Foreign Office said in a statement, "We have considered it advisable to withdraw our representation in Tehran during the present difficult and unpredictable period in our relations with Iran."

"There has been a series of attacks on Britain, a series of threats made by people who have some authority in Iran over the last week or so," added Deputy Foreign Secretary Douglas Hurd."We thought that the risks being run by leaving the last four (British diplomats) there were too great -- the risk of waking up one morning and finding that they too were hostages."

Since the Iranian demonstrators were arrested and jailed here Aug. 4 four Britons have been detained in Iran: three Anglican Church mission workers and a businessman. British diplomats have been rebuffed in attempts to see them or find out why they are being held. About 100 other Britons still living in Iran have been warned by Britain to leave.

There is particular concern about the safety of three church workers, who include Jean Waddell, the former secretary to the Anglican bishop in Iran, because of a violent Iranian campaign against the Anglican Church there. The businessman, helicopter company executive Andrew Pyke, was arrested without explanation as he was about to leave Iran a week ago.

Iranian Prime Minister Mohammed Ali Rajai then warned Britain in a message broadcast in Tehran last Thursday that Iran would make "an appropriate reaction" if what he called "cruelties" against the Iranian students arrested here were not stopped.

Other Iranian officials accused British police and jailers of mistreating the students, charges the British authorities have denied.

Prime Minister Rajai also demanded a British government review of, and change in, its "attitude toward the Islamic revolution of Iran, as well as an urgent end to biased propaganda against the Islamic republic."