The departure of a top-ranking South African diplomat from the United States two months ago was connected to "acts of an intelligence nature," diplomatic sources confirmed yesterday.

The diplomat, Daniel J.J. Opperman, reportedly known by U.S. officials to be the chief operative for South Africa's National Intelligence Service here, left Washington in mid-October. Listed as a first secretary, he was described by an embassy spokesman as performing general political duties.

Whether Opperman was asked formally to leave the United States or was withdrawn voluntarily remains unclear. State Department officials familiar with the case refused to comment, saying only, "We're just not saying anything about that particular individual. I just can't elaborate."

When pressed, one official said, "Maybe it's not in our interest to go any further," and suggested that South Africa may have taken action against an American diplomat before the U.S. moved against Opperman. The official would not elaborate.

A spokesman for the South African Embassy said the Foreign Ministry in Pretoria had issued a statement saying that Opperman was transferred routinely, and that there had been no request for his recall or complaints to the South African ambassador about his activities.

"There are intelligence liaisons in most major embassies, so this must have been something highly unusual, perhaps involving American citizens," said one source. "There are a lot of anti-apartheid groups in this city."

Reports about Opperman first appeared in The Rand Daily Mail, a prominent South African newspaper, over the weekend. They said he had been connected with "harassment" of American anti-apartheid groups.

The British government revealed late last week that it had asked for the withdrawal of a South African Embassy employe in London for actions against black nationalist groups in that country.

The employe, Joseph Klue, was a member of the London embassy's administrative and technical staff, a much lower rank than that held by Opperman. He was asked to leave Britain for "activities incompatible with his official status," diplomatic language for spying,

Klue, according to court testimony, had hired men to break into the offices of black nationalist and anti-apartheid groups in London.

A spokesman for the British Embassy, when informed of the Opperman case, said there had been no links established between the two cases other than the similiarity of timing and apparent purpose of the operations.

The British case, according to court testimony, involved break-ins targeted against major anti-South African organizations, including the African National Congress, the best-known of South Africa's black underground groups; the Pan-Africanist Congress, another major black nationalist group; and the South West Africa People's Organization, a guerrilla group fighting South African rule in Namibia.

None of these groups are particularly active in the Washington area, but organizations involved in promoting anti-apartheid programs have reported unusual activities at their headquarters in recent months.

Randal Robinson, head of TransAfrica, a black American lobbying organization for Africa and the Caribbean, said his offices at 545 8th St. SE have been the target of almost weekly break-ins for several months.

"File drawers are left open. Things are moved around, but nothing is taken. Obviously people come here for reading," Robinson said, adding that at least once an internal memo written to him by a staff member was leaked to a South African newspaper.

Robinson said that in each instance an elaborate alarm system was circumvented.

Another group, the Southern African Support Project, reported an unusual break-in last spring during a telethon campaign to raise money for medical and school supplies. The office where the telethon lists were kept was entered but no office equipment or other valuable items were taken.

Security disputes between South Africa and the United States are not unprecedented. South Africa ordered three U.S. military attaches and the U.S. ambassador's plane to leave the country in April, 1980, on charges that the plane had been equipped with a secret camera with which U.S. officials took pictures of sensitive ground installations.

The United States retaliated by expelling three South African military attaches.

This argument occurred during the Carter administration when relations between the two countries generally were very strained and involved more traditional intelligence operations.

The United States and South Africa have been on relatively good terms during the Reagan administration as Washington has pursued a policy of "constructive engagement" designed to win cooperation for change from Pretoria with the carrot rather than the stick.