Libya has agreed under British government pressure to withdraw from its diplomatic mission here four Libyans accused of threatening antigovernment Libyans living in London.

Meanwhile in Washington, a State Department official reported that about 20 Americans -- mostly businessmen and teachers -- were deported from Tripoli and arrived in Frankfort Monday night. The official said the Americans said that at least two other Americans were being held in a Tripoli jail reserved for political prisoners. No official reasons were given for the deportations, he said.

[A Tripoli radio broadcast said 25 Americans accused of espionage had been expelled, according to an Agence France-Presse report.]

The British government had asked for the removal of the four unnamed men earlier this month, at about the same time that the United States ordered the expulsion of four members of the Libyan mission in Washington who were later described by President Carter as "would-be assassins." After intensive diplomatic negotiations, Libyan leader Col. Muammar Qaddafi agreed to the British request over the weekend.

The announcement came as Libyan students loyal to Qaddafi today took over the Libyan embassies in Austria, East Germany, Poland, Yugoslavia, Czechoslovakia, Turkey, Bangladesh and other countries. They announced that they were transforming them into committee run "people's bureaus" such as those similarly taken over in Washington, London and six other capitals last September.

The embassy takeovers were all accomplished peacefully, according to spokesmen for the committees now running the missions.

Britain's deputy foreign secretary, Douglas Hurd, said in Parliament today that the four men being recalled by Qaddafi from London "have been involved in activities incompatible with their functions" at the Libyan mission here. Other sources said this involved harassing Libyan exiles who have been threatened with death if they do not heed warnings by Qaddafi to return to Libya.

Hurd said there is no evidence directly implicating the four men in the slaying of two prominent Libyan expatriates in London a week apart in April. Three Libyan suspects have been in police custody since the killings, and three more are being sought.

Three other Libyan exiles have been slain in Rome and one in Bonn, with the two most recent killings in Rome and Bonn occurring over the weekend. Government officials in several capitals suspect that these crimes are connected to the transformation of the Libyan embassies into "people's bureaus" and to recent official Libyan pronouncements calling for "physical liquidation of the enemies of the revolution abroad."

While some accredited diplomats have stayed on at the converted Libyan missions, they have been joined by men without diplomatic status -- usually students -- including those who have formed the committees now running the missions. This has worried British and American officials, for example, because it makes it difficult to observe and enforce standards of diplomatic conduct or expel someone who violates them.

Qaddafi reportedly also agreed over the weekend under British pressure to register the "secretary general" of his "people's bureau" in London as a diplomat.

British officials conducted their negotiations with Qaddafi carefully because about 5,000 Britons live and work in Libya and the two countries carry on a large amount of trade. However, Qaddafi's recent threat to cut off oil to Britain and the United States does not worry the British, who buy negligible amounts from Libya and produce similarly high quality crude from the North Sea.