Amid the international censure of Nicolae Ceausescu, and the rush to recognize the revolutionaries who deposed and executed him, it seems hard to recall that Ceausescu, like Gen. Manuel Antonio Noriega of Panama, was once a pet of Washington.

The Johnson and Nixon administrations in particular adopted Ceausescu as their favorite communist, because of his supposed independence from Moscow. To this end, they ignored his human-rights abuses, helped him destroy his country`s economy, funneled investment to Romania and may even have kept him in power.

After the Soviet invasion of Czechoslovakia in 1968, President Lyndon Johnson warned Soviet leader Leonid Brezhnev against invading Romania too. Although there never was any evidence that Brezhnev planned to invade, the Johnson warning guaranteed that the Soviets would keep their hands off Romania. It also ensured that when the more moderate Gorbachev government came to power, it would have no influence in Bucharest.

Richard Nixon already had formed a friendship with Ceausescu. In 1967, before he announced his candidacy for president, Nixon went to Moscow, hoping to win votes by engaging Soviet leaders in a repeat of his ''kitchen debate'' with former leader Nikita Khrushchev. The Soviets, knowing this, ignored him; and Nixon, deflated, went on to Bucharest, where the shrewd Ceausescu rolled out the red carpet.

Nixon never forgot. One of his first foreign trips after his election was to Romania. The U.S. gave most-favored-nation trade treatment to Romania while denying it to other communist countries. More important, the Nixon administration twisted the arms of American bankers and business leaders to persuade them to loan and invest money in Romania.

The reason lay totally in foreign policy. In the early 1960s, Ceausescu fought off a Soviet attempt to turn his country into an unindustrialized breadbasket for the Soviet bloc, and he got away with it. After that, he criticized the Kremlin, refused to join in the invasion of Czechoslovakia, recognized Israel and West Germany and permitted Jews to emigrate.

The Soviet Union permitted this for two reasons. First, Ceausescu continued to run a rigidly hard-line communist state at home. Second, Romania, unlike Hungary or Czechoslovakia, is not strategically important, and Ceausescu`s mild apostasy irked the Soviets but did not threaten them.

''We could squash him just like that,'' a Soviet diplomat said at the time, implying that Brezhnev didn`t feel it was worth the effort.

The anti-Soviet basis of American policy meant that anyone who irritated Moscow, no matter how unsavory his practices at home, got American support. Ceausescu knew this and capitalized on it.

The U.S. Embassy in Bucharest was under orders from Washington to put a shine on Ceausescu while soft-pedaling his shortcomings. Thus the American businessmen and bankers heard from U.S. diplomats about the strength of the Romanian economy and the safety of their investment.

Unfortunately, it wasn`t true. The loans were going into factories that were to produce goods that could be sold in the West, to earn the money to repay the loans. As American journalists wrote at the time, the money was wasted. Poorly trained workers in inefficient factories commanded by central planners turned out shabby goods that could not be sold abroad.

The end result was the foreign debt that led to Ceausescu`s worst excesses. Determined to pay it off, he began exporting everything he could-food, clothing, energy-reducing his own people to near starvation in their heatless, lightless homes.

All the appurtenances of repression were in place when Nixon came calling. The secret police enforced Ceausescu`s rule; television and newspapers extolled his virtues; the Hungarian minority was persecuted;

foreigners were tailed; and emigration was all but banned.

It was American policy to turn a blind eye to all this while keeping a chill on relations with reformist Hungary next door. The reason was that, while Hungary ran a relatively liberal domestic policy, it paid for this by lining up with Moscow on all foreign-policy matters-which, in those days, was what counted.

Neither liberal Hungary nor repressive Romania has changed in its essence since then. It is American policy, catching up to realities beyond the Cold War, that has reversed.