Senate and House committees voted yesterday to approve President Reagan's long-delayed agreement to share nuclear-power technology with China, but both panels blocked any shipments by U.S. corporations until the president receives firmer assurances that China will not divert material to countries trying to build nuclear weapons.

In a strong rebuff to the administration's handling of the nuclear accord, the Senate Foreign Relations Committee voted 11 to 3 to set the new conditions. Hours later the House Foreign Affairs Committee agreed to the same language on a voice vote.

White House and State Department officials worked until late Tuesday to water down the conditions, according to one source. The administration has argued consistently that the agreement, which was initialed by President Reagan during his 1984 trip to China, met all legal requirements and nonproliferation concerns.

After yesterday's votes, administration spokesmen were careful to say they could live with the conditions. "We have looked at this and concluded it will not undercut the implementation of the agreement," said James B. Devine, a deputy assistant secretary of state involved in the negotiations.

The resolution requires a 30-day waiting period for issuing export licenses for U.S. nuclear technology after a corporation has won a contract from the Chinese. During that time, the president must certify to Congress that the administration has clarified how the United States would prevent China from diverting that technology to third countries and that "China has provided additional information concerning its nuclear nonproliferation policies."

The resolution does not give Congress veto power over proposed nuclear shipments, but administration officials nonetheless fought the restrictions because they set up a series of hurdles that could make it more difficult for U.S. firms to compete for China's nuclear business.

The votes followed a classified briefing for senators last Friday in which Central Intelligence Agency officials catalogued evidence showing that while China engaged in what Sen. Alan Cranston (D-Calif.) earlier described as "the most egregious effort in history to export nuclear bomb-making know-how" to Pakistan, Chinese officials have improved their nonproliferation record over the past two years.

News reports in 1983 and 1984 disclosed that China may have secretly shared nuclear warhead design information with Pakistan and appeared to be assisting Pakistan's attempts to produce highly enriched uranium for weapons.

More recently, U.S. intelligence agencies have gathered evidence that China has continued this year to supply some nuclear material to Argentina and South Africa.

The CIA also learned through sensitive intelligence channels that Chinese officials last June discussed the possibility of providing nuclear equipment to Iran, according to a mid-September report in the top-secret National Intelligence Daily, which circulates among senior administration officials. The discussions took place during an official visit to Peking by the Iranian parliament speaker, Hojatoleslam Ali Akbar Hashemi Rafsanjani, who also was arranging to purchase surface-to-surface missiles from China, according to one news report.

China already covertly sells arms to Iran in its war with Iraq, according to intelligence officials, though Chinese officials have denied such sales and maintain official neutrality in the conflict.

Cranston said during yesterday's committee meeting that nothing in the classified briefing contradicted the evidence he cited from public sources in a harshly worded floor statement two weeks ago.

Yesterday's compromise was worked out over the past two days by staff members of Foreign Relations Committee Chairman Richard G. Lugar (R-Ind.) and Cranston, who along with Sens. Jesse Helms (R-N.C.) and John Glenn (D-Ohio) have voiced strong opposition to the agreement. Glenn and Sen. David F. Durenberger (R-Minn.), chairman of the Senate Select Committee on Intelligence, have cosponsored legislation with even more stringent restrictions.

Lugar said yesterday before the vote that he had been assured by Senate Majority Leader Robert J. Dole (R-Kan.) that he would bring the resolution to the floor for a full Senate vote if there was a clear majority in committee for attaching conditions to the agreement.