The government of China has formally protested the expulsion of two of its diplomats from the United States after they were charged last week with activities "incompatible" with their diplomatic status, the State Department said yesterday.

State Department spokeswoman Phyllis Oakley told a news briefing, "We have received a protest from the Chinese . . . . I understand that they have protested both in Beijing and in Washington." She said she was not aware of a response from the United States to the Chinese government, but added that such a communication would be considered a "confidential diplomatic exchange."

Asked about claims by the Chinese that the two diplomats were framed, Oakley said, "We requested the departure of the two diplomats because they were engaged in activities incompatible with their diplomatic status. I really have nothing further beyond that."

The State Department has refused to reveal the identities of the two men who were detained early last week by the Federal Bureau of Investigation on suspicion of espionage or to give any details about their activities. Federal sources have said one of the men was taken into custody by the FBI in a Chinatown restaurant as he was accepting documents he believed were classified.

Wu Zurong, the second secretary in the press section of the Chinese Embassy identified the men earlier this week as Hou Desheng, an assistant military attache, and Zhang Weichu, the Chinese consul in Chicago. The two men, the first Chinese diplomats expelled since the United States and the People's Republic of China established formal diplomatic relations in January 1979, left the United States on Dec. 24 and Dec. 27.

Although Justice Department sources have said privately that the two diplomats were believed to be engaged in espionage, the United States has stated officially that the two were involved in unspecified activities "incompatible" with their diplomatic status.

The matter is being treated far more delicately than past cases involving Soviet diplomats, when identities and details of alleged espionage have been quickly made public.

State Department sources have said there is deep concern that the affair should not be allowed to damage relations between the United States and China.

Asked whether the United States expects retaliation by the Chinese government, which could include the expulsion of U.S. diplomats, Oakley said, "That's not a question I can help you with." The foreign ministry in Beijing said yesterday that China reserves the right to take action beyond a formal protest.