It was hailed as a historic event just two years ago: Chinese Premier Zhao Ziyang on his first U.S. visit, toasting friendship, peace and cooperation to President Reagan at a glittering White House state dinner.

It was followed a few months later by an equally historic journey: a conservative American president standing in Peking's Great Hall of the People to bless the initialing of an agreement for "peaceful nuclear cooperation," or at least a chance for the sagging U.S. nuclear power industry to cash in on the electrification of the Chinese mainland.

These warm and solemn ceremonies -- and the unprecedented accord to share nuclear power technology with a communist former adversary -- seemed to be a watershed for a president whose foreign policy outlook had been shaped by a generation of hostility toward "Red China."

But the history of the nuclear accord would unexpectedly provide a troubling glimpse of China's past involvement in the murky world of nuclear proliferation as well as a practical illustration of the trade pressures that often drive diplomacy. It is a history of unorthodox negotiations leading to an agreement that quickly fell apart and, during the latter half of 1985, was pieced back together in a contentious struggle between the White House and a Senate coalition still alarmed by China's clandestine nuclear commerce.

Reagan's great success in Peking crumbled over a period of weeks after Air Force One returned his party to Washington. The reason: fresh intelligence reports showed Chinese scientists had been spotted again at a secret nuclear facility in neighboring Pakistan.

U.S. officials suspected that President Mohammed Zia ul-Haq of Pakistan was trying to assemble the materials for an atomic bomb -- the first "Islamic bomb" -- that threatened to destabilize the entire region and inflame Pakistan's rivalry with India, which U.S. policymakers had been seeking to defuse through aid programs to both countries.

Why was China helping such a bomb-making effort? What had become of China's pledge against the spread of nuclear weapons so eloquently stated by Premier Zhao as part of his White House toast?

According to a number of senior administration and congressional officials interviewed for this article, which examines the China nuclear deal and its impact on U.S. foreign policy, no one in the Reagan administration could answer those questions even though a year of negotiations preceded Reagan's April 1984 trip to Peking. And the Chinese were not talking.

After Reagan's return, the Chinese bluntly rebuffed all inquiries. Thus, without any answers, Reagan's senior foreign policy advisers concluded that the nuclear accord could never survive congressional review.

"There is no question that it blew up in their faces when they got back from Peking," a Republican Senate aide said.

The China agreement narrowly survived a divisive struggle that pitted State Department negotiators, who favored nuclear cooperation, against Central Intelligence Agency and Defense Department analysts who saw the contradiction between China's public statements and its covert assistance to some aspiring nuclear powers.

Today, the future of the agreement is clouded by deep suspicions in Congress, which can be expected to closely monitor every transaction. China's vision of a dozen nuclear-electric power stations along its coastal rim may have been largely a mirage, now rapidly fading as cash-strapped fiscal planners see no prospect of western financing and who may turn to coal-fired plants to generate electricity.

Still, to its supporters in the Reagan administration and in the community of "China hands" who helped open the door to relations with the mainland during the last decade, the accord represents a great achievement not so much for what it could do for the nuclear industry, but for how it has reversed China's longstanding and vocal advocacy for sharing nuclear weapons with the Third World as a hedge against superpower domination.

But to its critics, the agreement is founded on flimsy oral assurances that fall short of insuring that U.S. technology won't someday find its way into the bomb-making laboratories of the nuclear "outlaw" states.

As one Democratic Senate aide said recently, "Can you imagine if [President] Jimmy Carter had signed a major nuclear agreement with a communist power with shoddy verification procedures based on blind trust? He would have been cut to pieces on the Hill."

The seeds of the controversy were planted before Reagan took office in January 1981. Nuclear cooperation with China had been discussed during the Carter administration, but was deferred because the politics seemed too risky so soon after relations were formally normalized in 1979.

And the first two years of the Reagan administration were consumed by tensions over how to define the continuing U.S. commitment to the government on Taiwan, which had counted Reagan as one of its defenders over the years and which was seeking a continued flow of U.S. arms.

When the Taiwan question was defused by a joint communique in August 1982, China's growing need to electrify its vast rural and urban networks reemerged and was quickly seized upon by the ailing U.S. nuclear power industry, which feared extinction in the drastic cutback in new orders for nuclear power plants.

China's energy managers had drafted ambitious plans for hydroelectric, coal and nuclear power stations throughout the country. In the nuclear field they hoped to attract bidders and financing from the United States, Japan and West European nations whose civilian nuclear electric programs were highly developed.

The French firm, Framatome, using reactor technology originally licensed to it by Westinghouse, already was vying to lock up the flagship power station China was planning at Daya Bay near Hong Kong in a joint venture with the British colony.

The first real U.S. probe was made in late 1981 when American diplomats presented Chinese officials with a "model" nuclear cooperation agreement. But the Chinese quickly rejected it, scoffing at the suggestion that China would be willing to place any U.S.-built nuclear power plants under international "safeguards," a system of strict accounting procedures designed to detect the diversion of nuclear material for weapons manufacture.

Chinese officials noted indignantly that China had been a nuclear-weapon state since 1964. The imposition of safeguards was an encroachment on Chinese sovereignty, they said.

To this day, China refuses to sign the 1968 Nuclear Nonproliferation Treaty, which the Soviet Union and the United States have signed. The late Chinese Premier Chou En-lai called it "a great conspiracy against all peace-loving countries" and a decade later China's official news agency added, "The hegemonic practice of prohibiting the small- and medium-sized countries from developing their own nuclear weapons can deceive nobody."

U.S. officials did not see how they could go forward without China's acceptance of safeguards on U.S. sales of reactors and reactor components and to that end, then-Ambassador at Large Vernon A. Walters traveled to Peking in August 1982 to try to persuade Chinese officials to do so.

But the disappointment of Walters' mission was quickly overshadowed by a series of reports from U.S. intelligence that China was assisting Pakistan's secret nuclear program:

*Chinese scientific delegations began spending a substantial amount of time at a centrifuge plant in Kahuta where Pakistani scientists were attempting to produce enriched uranium, which can be used to trigger a nuclear detonation.

*Pakistani scientists from a secret facility at Wah showed a nuclear weapon design to some Chinese physicists in late 1982 or early 1983 and sought Chinese evaluation of whether the design would yield a nuclear blast. The Chinese scientists confirmed that it would.

*The triggering mechanism for the Pakistani bomb design appeared to be very similar to one used by China in its fourth nuclear test, suggesting that the Chinese provided the design to Pakistan.

There were reports of China shipping uranium to South Africa and "heavy water" to Argentina; the cumulative effect was explosive. But China consistently denied improper behavior, according to U.S. officials, and has refused to answer inquiries about its relations with Pakistan -- a long and trusted ally -- or any other aspiring nuclear power.

Secretary of State George P. Shultz traveled to Peking in the opening weeks of 1983 and gave Chinese leaders what was described as a blunt message: the United States would never consider entering into a nuclear cooperation agreement unless the two countries shared the same principles and commitment to halting the spread of nuclear weapons.

After Shultz's trip, in an effort to pull China into the majority of nations dedicated to curbing the spread of nuclear weapons, U.S. officials considered dropping their demand for safeguards on nuclear exports to China.

And just as suddenly, the negotiations were reborn. Shultz put in charge Richard T. Kennedy, a former Army officer and former Nuclear Regulatory Commission member, and by July 1983 a Chinese delegation to Washington announced that China would join the International Atomic Energy Agency [IAEA], the Paris-based organization dedicated to nonproliferation.

The Chinese officials had carefully studied U.S. export and nuclear control laws. They believed that safeguards were not legally required on nuclear equipment sales between two nuclear-weapon states. This narrow legal interpretation was adopted by the Reagan administration, according to senior officials.

But unresolved was the key question of how seriously China was committed to nuclear nonproliferation, a commitment that Shultz had said both nations must share.

According to several U.S. negotiators, Kennedy never sought a policy statement from China that would be written into the agreement. Kennedy believed the Chinese would not agree to this as a matter of national sovereignty. Instead, Kennedy and other U.S. negotiators conveyed to the Chinese that a "properly worded verbal statement" of China's policy would be sufficient.

This was the origin of what became one of the most controversial White House dinner toasts in recent history.

There was pomp and circumstance when Premier Zhao arrived in the United States for his first state visit in January 1984. He landed on a Sunday night at Williamsburg, Va., staging his diplomatic advance on Washington from a discreet distance. Chinese officials privately asked Kennedy to meet them in advance so they could unveil the text of the formal toast they proposed to make to the president and Nancy Reagan. It included, they pointed out, a historic paragraph.

The text of the toast was 700 words and covered all aspects of U.S.-China relations. The key section read:

"We are critical of the discriminatory treaty on the nonproliferation of nuclear weapons, but we do not advocate or encourage nuclear proliferation. We do not engage in nuclear proliferation ourselves, nor do we help other countries develop nuclear weapons."

U.S. officials were privately elated, but to their dismay, major news organizations gave what the officials considered inadequate prominence to this major shift in Chinese policy when the toast was delivered. The next morning on the other side of the world, Washington Post Peking correspondent Michael Weisskopf received a telephone call from a senior U.S. Embassy official, who complained that press reports from Washington had failed to highlight the policy pronouncement.

In a dispatch from Peking that day, Weisskopf quoted "an informed diplomat" in Peking as saying, "Zhao's statement would appear unequivocally to commit China to a nonproliferation policy consistent with U.S. interests."

But in neither capital did U.S. officials disclose that Zhao's White House dinner toast had become the cornerstone of the emerging nuclear cooperation agreement.

As Reagan prepared for his journey to Peking, the nuclear cooperation accord held the greatest promise as the substantive issue presidential image-makers were looking for in a trip they described privately to some reporters as long on friendship and short on substance.

But the outstanding disputes facing Kennedy's negotiating team were formidable. The Chinese had consistently refused U.S. inspection rights at nuclear facilities built with U.S. equipment and they had refused to accede to U.S. veto rights over the reprocessing of nuclear fuel from U.S.-built reactors.

Kennedy's negotiators went to China in mid-April, two weeks before the president and his entourage were scheduled to depart and in a final intense round of talks agreed, in effect, to defer the last and toughest issues into the future by stating, "The parties will use diplomatic channels to establish mutually acceptable arrangements for exchanges of information and visits to material, facilities and components subject to this agreement."

That was it. On April 24, U.S. officials told reporters that "an agreement is at hand" and one senior official, speaking on the condition that he not be identified by name, told The Washington Post that the negotiating team had "gotten what we need in the way of assurances" on China's nonproliferation policy.

During the presidential trip, reporters were briefed on the historic potential of the accord, but White House and State Deparment officials would not provide any details about the nonproliferation assurances in the agreement or the text of the agreement itself.

It was not until Reagan returned to Washington that State Department officials, briefing congressional staffs, disclosed the negotiating history.

It was immediately attacked in Congress as diplomacy by dinner toast.

Within weeks senators who were briefed on the continued presence of Chinese physicists at Pakistan's nuclear facility at Kahuta stepped up their attack and this led to a disgorgement of intelligence information about China's assistance to Pakistan in 1982 and 1983.

Aware of their mounting problems in Congress, the Chinese ratified Zhao's nonproliferation policy in a formal vote of the Chinese People's Congress, a captive body of communist party officials, on May 15. Chinese officials in Washington privately alerted U.S. officials to the import of this vote, but it was too late.

By the time Chinese Defense Minister Zhang Aiping came to Washington in June, administration officials had concluded that Congress would not approve the accord unless China gave additional assurances on nonproliferation. If the Chinese were unwilling to do so, the nuclear agreement was dead. Stormy Reaction by Chinese Aide

For the encounter, Shultz assembled his senior East Asia policy aides along with Kennedy. The Chinese had for weeks been alerted to U.S. concerns. Shultz said, according to one participant, "We do not know how to square certain [intelligence] information with your statements [on nonproliferation]."

The secretary said he believed that "more discussion" was necessary "to find out how you interpret the agreement."

The secretary's remarks, according to two observers, incited a stormy reaction by the Chinese official. "He did everything short of pounding the table," one official said. "We've given you all of the assurances we are going to give you," he said, suggesting that Shultz doubted Zhao's integrity when he toasted the Reagans and changed China's policy on nonproliferation.

"It was the new information that clearly was the monkey wrench," another U.S. official said. The presence of the Chinese physicists at Kahuta gave an unstoppable momentum to congressional demands for China to explain its behavior. This official said that as a practical matter, Shultz understood that the Chinese needed to provide answers to Congress because "Congress wanted to go back and insist on exhumation . . . of particular events."

Instead, the Chinese defense minister stalked out of Shultz's office. "We all believed that we had gotten as much . . . as we were going to get," this U.S. official said.

The agreement remained dormant for the remainder of the year while U.S. intelligence continued to monitor what appeared to be an ominous escalation of Pakistan's nuclear program. But with additional U.S. pressure, which included a personal letter from Reagan to Pakistan President Zia, Pakistan said it would slow its nuclear program. Meanwhile, China removed its technicians from Kahuta.

Last June, U.S. officials concluded that it was time to try again, and Kennedy was dispatched to Peking. In a hotel room outside China's capital, Kennedy gave the Chinese negotiators a long and detailed explanation of how the United States interprets a country's pledge against nuclear proliferation.

"We talked to them eye to eye about what it meant not to assist someone to make nuclear explosives," one participant said. Atom Accord Is Finally Signed

At the end of this conversation, Kennedy drafted a two-page memo summarizing the discussion and showed it to the Chinese. When the document was deemed satisfactory to both sides, Chinese officials said it basically represented their views and commitment to nonproliferation.

Kennedy did not attempt to get a Chinese signature on the document because the Chinese had taken a stand. Their policy was well-known, they said, and had been repeated a number of times. They would choose their own time to elaborate.

Kennedy returned to Washington and on the basis of the new oral assurances, Reagan signed the long-delayed nuclear accord during a visit of Chinese President Li Xiannian July 23, 1985.

It went into effect last month after the administration narrowly defeated several attempts in the Senate to require safeguards on any nuclear shipment to China.