David Henry Barnett, the first CIA officer the agency's 33-year history to be indicted on espionage charges, pleaded guilty today to having sold to the Soviet Union details of one of the most successful undercover operations the agency ever conducted against the Russians.

Besides telling the Soviets that many of the weapons they supplied to Indonesia between 1959 and 1969 were resold to the CIA, Barnett identified for them the Indonesian agent who arranged the resale and the 29 other Indonesians who helped this agent. And he told them that from these weapons and the technical data that came with them, the United States had been able to devise countermeasures against the Russian-built Sa2 antiaircraft missile used by the North Vietnamese against American bombers during the war.

A 25-page "statement of fact," to which Barnett did not object, also said that he told the Soviet Kgb (secret police) the names of Russian agents the CIA was hoping to recruit as double agents in Indonesia.

In an unemotional voice, Barnett pleaded guilty to a single charge of espionage before U.S. District Court Judge Frank A. Kaufman, who withheld sentencing until Dec. 9 while Barnett undergoes interrogation by the FBI and CIA to determine how much damage he did. Through the Justice Department, the FBI and CIA also told Kaufman they want to find out as much as they can about how the KGB operates when it buys the services of an American intelligence officer.

"Do you understand that what you are being charged with carries with it a maximum penalty of life imprisonment?" Kaufman asked Barnett.

"Yes, your honor, I do," Barnett replied without emotion, his hands clasped behind his back.

In detail as rich as that supplied by any spy novel, Kaufman was told just what it was Barnett had sold the Russians, how it might damage the United States and how Barnett went about in the two year ending in August 1977 passing what he knew on to the KGB. Kaufman was told that Barnett received a total of $92,600 from the Russians for what he gave them.

Justice Department Attorney George G. Matava told the court that Barnett handed over to the KGB the full details of a CIA covert operation code-named HABRINK, which Matava said was "very successful and provided a large volume of Soviet data and a limited amount of Soviet hardware on a large variety of weapons" deployed in Indonesia.

HABRINK gave the CIA enough information about the SAM missile, Matava said, that the United States could determine the radio frequency used to guide it in flight. Thus U.S. experts were able to devise countermeasures "that saved the lives of many bomber crews engaged in action in Vietnam."

HABRINK also revealed how long "W" class diesel-powered Soviet submarines could stay submerged without surfacing to recharge their batteries. Matava said this period of time "was longer than the U.S. had previously thought and that information was diseminated, under classification, within the American fleet."

"The information regarding this weaponry," Matava told Kaufman, "has never been available from any other source."

In addition, HABRINK provided details of the Soviet Styx naval surface-to-surface missile, the Komar guided missile patrol boat, the Riga-class destroyer, the Sverdlov-class cruiser, the TU16 (Badger) bomber and the Kennel air-to-surface missile.

Matava said Barnett told the CIA the Soviets shrugged off HABRINK as if it knew the weapons it gave to Indonesia would be compromised.

According to Barnett, Matava said, a KGB agent named Dimitry told Barnett: "The Americans got the information so they are happy, the agents got the money so they are happy and the Soviets got the benefits from supplying the hardware in the first place, so everybody's happy."

Matava said the exact opposite was true. He said the Soviet decision to supply new weapons to Indonesia was the "subject of an intense internal debate within the Soviet Union. . . . While debriefing Barnett, the KBG gave short shrift to HABRINK because it did not want to acquaint him with the value of the HABRINK operation or the value to them of learning that such an operation had taken place."

Almost as serious as Barnett's disclosure of HABRINK, Matava told Kaufman, was his revelation of who HABRINK was. Said Matava: "Barnett told the KGB HABRINK's true name. This agent is alive, though no longer active as a source. As a result of Barnett's actions, HABRINK is exposed to retribution if the Soviets found it to their advantage."

It all began in the fall of 1976, Matava told Kaufman, six years after Barnett had left the CIA to seek his fortune in a shrimp factory and a furniture export business in Indonesia. Both were failing and Barnett had fallen deeply in debt, Matava said.

Barnett went to the home of a Soviet cultural attache in Jakarta and offered to sell his services. Barnett was told to come back a week later, when he met the man who identified himself as Dimitry. By the end of the following week, Barnett had told Dimitry enough to be paid $25,000 in $100, $50 and $20 bills.

Three months later, Matava said, Barnett met three KGB agents in a KGB safe house outside Vienna. Barnett's trip to Vienna was right out of James Bond. He flew to Brussels, where he took a train to Antwerp for a business meeting with an unidentified associate. He took another train back to Brussels, then a third train to Vienna. He went back the same way, meeting again with his business associate in Antwerp.

What followed was more James Bond. Back in Jakarta in November 1977, Barnett was introduced to a man, identified as Igor. Igor, who later turned out to be Vladimir V. Popov, former third secretary at the Soviet Embassy in Washington, wanted Barnett to go back to Washington and get rehired by the CIA or hired by the Defense Intelligence Agency or the Intelligence and Research Bureau at the State Department.

Barnett went back, but failed to get any of the jobs. Along the way, Igor would contact Barnett by calling him at certain times and dates in pay phone booths at an Exxon station in Annandale, the lobby of the Bethesda Medical Building and a public phone at the corner of Wilson Lane and Cordell Avenue in Bethesda. A drop site was arranged near Lock 11 on the C & O canal in Maryland, where Barnett was to place a piece of red tape on the side of a nearby telephone booth to signal the KGB that the drop site had been serviced.

Matava said that neither of the phone booths at the Annandale Exxon station or the drop site on the C & O canal were ever used, but the phone in the lobby of the Bethesda Medical Building rang frequently. Always, it was "Igor" calling Barnett.

Through all the phone calls, Barnett had to tell Igor he'd been spectacularly unsuccessful at finding the kind of job Igor wanted him to get. Barnett was given $3,000 for another tri to Vienna for a meeting with the KGB at a radio shop at 64 Taberstrausse. By this time, it was April 1980, and though it has never been made clear how U.S. authorities found him out, an FBI legal attache from Bern was across the street from the radio shop verifying that the meeting was taking place.

While Barnett is the first CIA officer to be charged with espionage, he is not the first employe of the agency to be so charged. William Kampiles was arrested on espionage charges two years ago when he sold the Soviets the manual of how the KH11 surveillance satellite works.