The United States has protested formally China's failure to buy about $475 million in American grain, the first time Peking has reneged on a trade agreement with Washington since diplomatic ties were reestablished, diplomats said today.

A formal oral protest was made to Chinese Ambassador Zhang Wenjin in Washington earlier this month, the diplomats said, and followed up by expressions of "dissatisfaction" in Peking.

Diplomatic sources did not identify who made the protest in Washington, but said it was conveyed "at a very high level."

U.S. Trade Representative William E. Brock lodged the protest with the Chinese ambassador "to express disappointment that the terms of the agreement have not been fulfilled," according to a spokesman for the trade representative's office.

With the exception of China's cancellation of a cultural accord last year, retaliation for granting asylum to Chinese tennis star Hu Na, it was the first time that Peking has failed to honor an agreement with the United States since the two countries established diplomatic relations in 1979, diplomats said.

Although western diplomats had said they expected China to renege on its commitment to buy between 6 million and 8 million metric tons of American grain this year, the Chinese have steadfastly insisted that they will honor the grain agreement.

Today's disclosure, however, raises questions about China's reliability in international agreements at a time when it is trying to attract foreign investment.

Peking frequently boasts of its reputation for honoring international agreements. In fact, just two days ago, Chinese leaders, including paramount leader Deng Xiaoping, pointed to their record in honoring international agreements to reassure British Prime Minister Margaret Thatcher and jittery Hong Kong residents that China would keep its word to maintain a capitalist system in Hong Kong for 50 years after it reverts to Chinese sovereignty.

"There is no question that the failure to meet the commitment does reflect upon the general fidelity of China to its contracts," a diplomat said.

Under a four-year agreement that expires at the end of this year, Peking is obligated to buy and ship at least 6 million metric tons of U.S. wheat or corn annually. For the first two years, China exceeded its commitment. But last year Peking fell short about 2.2 million metric tons and as of late November, had purchased only 4.4 million metric tons in 1984, for a total shortfall of 3.8 million metric tons valued at approximately $475 million.

"The present grain agreement is lapsing and there won't be a new grain agreement," one diplomat said.

He said the formal protest was lodged about two weeks after a U.S. Department of Agriculture delegation held talks in Peking Nov. 20. At that time, the U.S. delegation, led by Richard Smith, administrator of the department's Foreign Agricultural Service, expressed its "deep disappointment" over China's noncompliance with the agreement.

Chinese officials have given no specific reason for not purchasing the grain, but have complained about prices and the discovery of the pesticide ethylene dibromide (EDB) in the wheat shipments, a diplomat said.

Because of bumper harvests, China has less need for American grain today than when the deal began in 1981. In addition, Peking is known to be unhappy over the recent tightening of U.S. textile import rules.