HARTFORD, CONN. -- In a heavily guarded second-floor courtroom here, one of the longest pretrial proceedings in American history is winding its way through a tale of massive government surveillance, botched wiretaps and alleged FBI misconduct.

During more than 2,000 hours of electronic surveillance, federal agents have acknowledged, they illegally listened in on conversations without recording them. Some agents also have admitted that they made a "bootleg" set of tapes, which was not disclosed to the defense for more than a year, and that they signed false affidavits about the wiretap procedures.

Defense lawyers who have reviewed the tape recordings say the Federal Bureau of Investigation also eavesdropped on some defendants as they took showers with their wives and had romantic conversation. Federal prosecutors dispute these accounts.

On paper, at least, 16 people stand accused of plotting a $7 million heist that took place at a Wells Fargo depot here on Sept. 12, 1983. But the real focus of the case is the government's contention that the defendants, all supporters of the Puerto Rican independence movement, are leaders of a secret terrorist organization called Los Macheteros, the machete wielders.

Last week, the trial judge set bail at $1 million for one of two defendants in the case who have been imprisoned without bail for a record 29 months, despite vociferous protests from their lawyers. No one expects the trial, which could last a year or more, to begin until this summer or fall.

"I think the government is drowning in this case," defense attorney Diane Polan said. "They're unable to manage it and unable to bring it to trial."

John R. Williams, another defense lawyer, called the surveillance "purely an intelligence-gathering operation. The majority of people in this case, including my client, have never set foot in the United States. I take that back -- he went to Disneyland once."

The six-man prosecution team says there is no evidence to support defense charges that the FBI tampered with the tapes, routinely monitored personal conversations or recorded sexual activities. They have urged Senior U.S. District Court Judge T. Emmet Clarie not to throw out the more than 1,000 tapes recorded by 100 agents over 18 months.

"We will demonstrate that the tapes have not been tampered with," prosecutor William J. Corcoran said. He said it is "commonplace" for FBI investigators to make an extra set of recordings and denied that their existence was withheld deliberately from the defense.

Nevertheless, Corcoran said: "This was a lengthy investigation in which there were a lot of opportunities for mistakes to be made. There were some mistakes made here, no question about that . . . but there was no widespread violation of the law. I'm not being defensive or apologetic, but you had agents coming into San Juan for 60 or 90 days. They come in on a Sunday and they're monitoring {conversations} on Monday."

The 67-page indictment in United States v. Victor M. Gerena et al. contains almost no details of how the 16 defendants allegedly conspired to help Gerena rob the Wells Fargo depot, where he worked as a guard.

Gerena has fled to Cuba, the government says, and his alleged $7 million haul is nowhere to be found. But the Justice Department has spent more than twice that on prosecutors' salaries, fees for court-appointed defense attorneys, teams of federal marshals and translators for the Spanish-language tapes.

At bail hearings, where detailed evidence need not be presented, prosecutors have charged that some of the defendants were involved in such violent incidents as a 1979 ambush of a Navy bus that left two men dead and a 1983 rocket attack on a federal building in Hato Rey, Puerto Rico. Corcoran said he did not know why no one has been charged in those attacks.

Seven defendants were held without bail for up to 16 months until an appeals court ordered their release in late 1986. Bail was set last week for Juan Segarra Palmer. He and Filiberto Ojeda Rios have been incarcerated in a Hartford prison based on government contentions that they might flee.

Segarra's attorney, Leonard Weinglass, said his 2 1/2-year detention "goes beyond the outrageous." Segarra and his codefendants refuse to say whether they are members of Los Macheteros, which claimed responsibility for the Wells Fargo robbery and numerous acts of violence.

Judge Clarie has rejected defense attempts to have the trial moved to Puerto Rico, where much of the alleged conspiracy took place. The defense says prosecutors are holding the trial in Connecticut because they would be unlikely to win a conviction from a Puerto Rican jury.

One thing about the case is beyond dispute. Since the first arrests in predawn raids on Aug. 30, 1985, it has come to dominate the lives of nearly everyone involved.

Several Puerto Rican defendants have moved here to be near the proceedings and have enrolled their children in Hartford schools. Some defense lawyers have rented apartments here. Corcoran, deputy chief of the Justice Department's narcotics section, commutes from Washington each week.

The defense lawyers, all court-appointed and limited to $60 an hour in fees, most seem to relish the combat. They include William M. Kunstler and others who have represented such defendants as the Chicago Seven, Bobby Seale and Daniel Ellsberg.

If the government's conduct rather than the defendants' seems to be on trial here, it may be because little has been said about the robbery. Defense lawyer Michael Deutsch calls the trial "a vehicle to criminalize the independence movement," while Weinglass sees it as a study in U.S. "colonialism."

For several months, as both sides have argued over whether the FBI tapes should be suppressed, the proceedings have inched forward. One recent morning was devoted to playing a tape cassette on which the defendants chatted idly in Spanish while a television was on.

In testimony that day, FBI agent Luis A. Rivera said he made an extra set of recordings on cassette machines only while the "official" reel-to-reel tapes also were recording. But he admitted that some of the cassettes played in court contained material not on the official tapes. "I have no explanation for it," Rivera said.

The existence of a "bootlegged" set of cassette recordings -- all but 30 of which have been erased -- came to light last summer in an affidavit from a senior FBI supervisor in the case. Since other agents had claimed in previous affidavits that all taped evidence had been turned over to the defense, the bureau promptly arranged to submit new affidavits.

The disclosure prompted defense charges of tampering. In some cases, only three words found on the cassettes were missing from the reel-to-reel tapes, indicating that reels had been changed in less than three seconds, which FBI agents said was impossible. A tape expert hired by the defense said that some of the reel-to-reel tapes were not the original recordings.

Corcoran said the government disclosed the existence of the extra set of tapes as soon as it was discovered. "It wasn't that we were forced into it or boxed into it," he said.

There is "no dispute" that the two sets of tapes contain substantial discrepancies, but this was "inadvertent," Corcoran said. He said the agents complied with federal rules requiring them to stop monitoring personal conversations.

There is evidence of other irregularities. Prosecutors acknowledge that the FBI sometimes waited weeks or months before placing the tapes under court seal, as required by law, although they dismiss the issue as minor. Frank J. Bove, the official who supervised the wiretaps, testified that he had little knowledge of federal wiretap laws before being assigned to the case in 1983.

Two FBI agents, Tyler Morgan and Abelardo Alba, have admitted that they listened to some defendants' conversations without recording what was said. Federal law requires all court-approved wiretaps to be recorded so they can be reviewed by a federal judge.

Morgan testified that he signed a 1986 affidavit saying he had never illegally monitored conversations but that he later crossed out his name and signed a second affidavit disclosing it.

All this adds up to a picture of continuous and indiscriminate FBI surveillance, defense lawyers say. "They weren't interested in preparing evidence for a courtroom," Williams said. "They want to know what the guy had for breakfast, who he's sleeping with."

Still to be sorted out in the marathon proceedings are 5,200 photographs taken during visual and aerial surveillance and more than 150,000 documents.

In the end, the prosecutors' task is to show that a musician, farmer, therapist, lawyer, writer, exterminator and others living in Puerto Rico were engaged in a broad conspiracy to steal money to finance a violent revolution.

"They don't really claim that a lot of these people had anything to do with the robbery," Polan said. "That's why it's such a political case."