A Hungarian-born New Yorker was charged today with spying for Soviet-bloc military intelligence after he allegedly purchased classified U.S. Army documents from an Army warrant officer in Augusta, Ga., for $4,000.

Otto Attilla Gilbert, 50, who also goes by the last name "Gyepes," was being held without bond in a county jail after his arrest by FBI agents Saturday in Augusta. Gilbert, of Forest Hills, N.Y., had allegedly consummated a deal with Army Warrant Officer Janos Szmolka, a criminal investigator at the Fort Gordon Army base there.

Szmolka was playing double agent all along.

An FBI agent said at a news conference that the espionage arrest was one of the biggest in U.S. history, but a Justice Department official who specializes in counterintelligence investigations characterized the alleged espionage attempt as "an incredibly sloppy operation."

"We found it hard to believe they would go ahead with it. We're used to much tighter operations," the Justice official said. "A first-class intelligence outfit would have never gotten involved in this."

Documents filed in federal court today say the alleged operation began in Budapest in 1977 and ended Saturday near a Confederate War Memorial in Augusta, where Gilbert approached his contact, Szmolka, and said, "Where's the Peachtree Plaza Hotel? I am from out of town."

Szmolka wore a multicolored camera strap over his right shoulder. In his hand was an Augusta Herald newspaper. Hungarian agents, in letters to Szmolka, a career Army officer, asked him to carry the props so their contact could pick him out in a crowd.

But the foreign agents were unaware that Szmolka would also be sporting a body "bug," specially fitted by the FBI, which transmitted his conversation to federal agents nearby. His van had also been wired for sound. That's where the transaction occurred just after noon Saturday, according to an affidavit by an FBI agent.

According to the affidavit, Szmolka, a naturalized U.S. citizen, was offered $100,000 by Hungarian espionage agents to steal secret U.S. documents. He was recruited during a trip to Budapest to see his family in December 1977, presumably on holiday leave from his duty station with the Army in Mainz, West Germany. He immediately informed American officials, who turned him into a double agent.

For the last four years, Szmolka has played the role of a money-hungry turncoat as he duped Hungarian spies from Vienna to Budapest, exchanging coded letters and dozens of cryptic phone calls. The intrigues finally led to the rendezvous in a sleepy southern town more noted for golf courses, drooping magnolias and mint juleps than spies.

The affidavit also names Lagos Perlaki, described as an agent with Hungarian military intelligence, as the spy who recruited Szmolka.

In a December 1979 meeting in Vienna, Szmolka allegedly was given two addresses to write to in Hungary, a code to disguise the contents of the letters, and about $650 in West German and Austrian currency. U.S. agents were watching all the time.

In early 1981, Szmolka again flew to Vienna, where, according to court documents, Perlaki paid him $3,000 for 16 rolls of undeveloped film of unclassified documents.

Perlaki "reemphasized" that he wanted "secret" documents, the affidavit said. Szmolka was to write to a maildrop in a Paris suburb that he had obtained "1964 Kennedy half dollars," the code phrase for the desired documents. He was to refer to files from Army publications as "mint sets."

A meeting was arranged for Augusta, Ga., according to the affidavit. On March 27 of this year, Szmolka got a letter postmarked Vienna. "Isabelle is getting married," it read. That was a coded go-ahead signal. The "wedding date" was set for April 17, last Saturday, when FBI agents swooped down on Szmolka's van and confiscated money, classified documents and film cassettes Gilbert had packed in his flight bag.

Gilbert was searched and FBI agents found a piece of paper with the name, "Perlaki" and a telephone number, authorities said.

"I can't tell you anything about it," said Bela Juszel, press attache with the Hungarian Embassy in Washington. Asked if Hungarian agents cooperated with the KGB (the Soviet state police), he said, "KGB is KGB, Hungary is Hungary."

He said no one named in the affidavit was associated with the embassy. Col. Lazlo Mate, the military attache, said it was common knowledge that intelligence outfits of Soviet-bloc nations cooperated with the KGB, but he scoffed at the idea of a spy ring run out of his embassy. "I am a diplomat," he said. "My job is protocol."