The Soviet government today ordered an American diplomat in Moscow to leave the country, saying it had obtained evidence that he was engaged in espionage.

The expulsion of Louis Thomas, an attache in the U.S. Embassy, was announced by the government news agency Tass. It quoted the Soviet secret police KGB as saying that Thomas was "caught red-handed during a spy action in Moscow on June 2."

"In the course of the investigation," Tass said, "the evidence was obtained which fully exposed this American diplomat as a person engaged in espionage activities which are incompatible with his official status. For illegal spying actions, Louis Thomas was declared persona non grata."

A spokesman for the embassy, Franklin Tonini, confirmed that Thomas was ordered to leave the Soviet Union and said he and his family would depart "in the near future."

Tonini refused to provide any information about Thomas and declined to comment on Soviet charges against him. A State Department spokesman in Washington also declined to comment.

Thomas, a technical engineer in the embassy's security division, was not available for comment. His home telephone is hooked through the switchboard of the embassy, where he lives, and an operator said Thomas' phone was "broken."

The diplomat, who is in his mid-40s, has been in Moscow with his wife, Elizabeth, for the past two years. He was due to be transferred to another post next month.

He is the second American diplomat expelled from Moscow in the past three months.

Richard Osborne, a first secretary in the embassy's economic section, was declared persona non grata in March after Tass announced that he had been caught "red-handed" while operating a portable "special purpose" transmission device capable of relaying information via space satellites.

Since Osborne's expulsion, the Soviet media have featured several articles about alleged operations of the U.S. Central Intelligence Agency here.

Last week, Sue Pamela Carne, an American governess living with the family of an embassy first secretary, was accused of being a CIA agent and having been involved in spreading subversive religious literature. Tass said Carne had attended a gathering of Jehovah's Witnesses outside Moscow. She left the country on short notice and before her case was made public.

U.S. sources here said Thomas was an electronics specialist in the security division. It was not known where he was seized by KGB agents and under what circumstances. Osborne was believed to have been lured into a trap by the KGB.

The latest Soviet actions follow a series of embarrassing expulsions from western countries of Soviet diplomats, journalists and trade officials. More than 60 of them have been declared persona non grata on espionage charges, including the spectacular exodus from France of 47 Soviet officials expelled in April.

In addition, Iran recently expelled 18 Soviet diplomats on espionage charges.

The United States ousted three Soviet diplomats on spying charges in April. Washington, however, did not retaliate following Osborne's ouster.

While the Russians did not retaliate against French personnel in Moscow, they expelled a British diplomat and a journalist in response to the ouster of three Soviet officials from Britain.