The United States traded three convicted spies and one under indictment today for 23 prisoners held in East German and Polish jails in what diplomats described as the biggest East-West swap of its kind in Europe.

The exchange, culminating three years of secret negotiations, took place at noon today across the Glienecke Bridge in Berlin, according to U.S. officials. It was attended by U.S. Assistant Secretary of State Richard Burt and Wolfgang Vogel, an East German who is a close confidant of the East German head of state, Erich Honecker.

The three East Bloc spies and one accused spy, including two East Germans, a Pole and a Bulgarian, were flown to West Berlin from the United States overnight. They were handed over later to Communist authorities in the middle of the bridge that separates West Berlin from East Germany.

Western sources involved in the swap said it was evident that the East Germans were exceptionally eager to gain the release of Alfred Zehe, a Dresden physicist who was sentenced in Boston in April to eight years in prison for buying classified military material from a U.S. Marine who posed as a traitor.

"It's been obvious since his arrest that Zehe was quite important to them," an informed western official said. "There's no question that East Germans were really dismayed when he got his finger caught in the cookie jar."

The other East German spy freed in the exchange was Alice Mickelson, 67, who was seized last October as she boarded a flight from the United States to Czechoslovakia with a tape recording of classified material stuffed in a cigarette package. Mickelson, a grandmother who was cited in court papers as a professor of Marxism in East Berlin, was sentenced in June to 10 years in prison, which was later reduced to five years probation.

The rickety span of the Glienecke Bridge, used primarily by western military liaison units crossing into East Germany, has served as the setting for numerous spy trades in the past. The most famous exchange, in 1962, involved the release of Francis Gary Powers, U2 reconnaissance plane pilot shot down over the Soviet Union, for the master Soviet spy Rudolf Abel.

The 23 East European prisoners were taken to the center of the bridge, where they boarded a U.S. military coach to be driven into West Berlin. They were flown later to West Germany, where many were taken to the main refugee center in Giessen, which processes East Germans.

Two other prisoners, described as East Germans who stayed behind to settle personal affairs, will be allowed to leave for the West with their families in the next two weeks, U.S. officials in West Berlin said.

Burt, who is expected to become the next U.S. ambassador to Bonn later this summer, flew to Berlin to oversee the East-West spy swap following a meeting of NATO foreign ministers in Portugal last week.

He told reporters following today's exchange that the trade was "particularly satisfying" for the West because of the disproportionate release of 25 people in return for four East Bloc spies.

Burt refused to characterize the 25 unidentified prisoners from Eastern Europe as spies or political detainees, saying only that they were now "very, very happy people." But other U.S. officials indicated many of them were incarcerated on charges of espionage.

The Pole released by the United States was named as Marian Zacharski, jailed for life in 1981. The Bulgarian was identified as Penyu Kostadinov, who was indicted in September 1983 on charges of delivering U.S. defense information to a foreign government.