The FBI and D.C. police conducted an extensive undercover investigation last year in which they hoped to videotape then-D.C. Mayor Marion Barry accepting a bribe, according to court documents that were unsealed yesterday.

The sting operation--which never took place and netted no charges--was planned after a D.C. police lieutenant was secretly arrested on corruption charges in February 1998. The lieutenant, Yong H. Ahn, agreed to aid authorities in the Barry probe, bringing his wife, Azita Ahn, into the plan and having her attempt to buy a job with the city, the documents revealed.

The court papers show the extent to which authorities continued to pursue Barry, who triumphantly returned to the mayor's office in 1995, nearly three years after his release from prison on a misdemeanor drug charge--which itself resulted from an FBI sting. As recently as 1998--18 years after the first of many inquiries into his public and private life went nowhere and even as his political career was ebbing--Barry remained very much a target for law enforcement agencies.

In the documents, Azita Ahn quotes an FBI agent as saying "they would get him with a felony and he would never get away with this."

The government's latest effort was derailed when news of Ahn's arrest was leaked to the media in April 1998, on the eve of the operation. But it wasn't until yesterday--two days after Ahn was given a four-month sentence for accepting illegal gratuities from the operators of illegal massage parlors--that the story of the Barry investigation came to light, after U.S. District Judge Thomas F. Hogan unsealed transcripts and other papers.

Officials with the FBI and the U.S. attorney's office declined to provide details yesterday. "It's not appropriate for the FBI to say anything about this," said FBI spokeswoman Susan Lloyd.

U.S. Attorney Wilma A. Lewis released a statement saying prosecutors "listen to and investigate any credible allegations of criminal conduct and follow them wherever they lead." But, she said, her office "evaluated the information proffered and did not authorize a sting operation."

Under Justice Department regulations, a sting operation would require the approval of the U.S. attorney's office. Sources familiar with the case said Lewis did not authorize the sting to go forward because prosecutors did not believe enough groundwork had been laid to support it.

Jonathan Shapiro, Yong Ahn's attorney, said the couple would have no comment about the developments. Shapiro said that he believed the news leak led authorities to call off the undercover operation and that he never was able to determine who was responsible for tipping the media to Ahn's arrest.

Shapiro declined to say what generated the allegations against Barry. The documents unsealed yesterday--nearly 300 pages of transcripts of court hearings that were closed to the public--do not say how the mayor's name surfaced in the probe.

But Ahn testified that a D.C. police investigator "mentioned several names" to him after his arrest, including the mayor's, indicating that authorities had already been focusing on Barry.

During one hearing, Shapiro told the judge: "Mr. Ahn through an intermediary would offer money to the mayor of this city to get his wife employment and Mrs. Ahn agreed to participate in that adventure. A false resume was prepared for Mrs. Ahn with the help of the FBI. . . . Her purse or bag was outfitted or was prepared to be outfitted with a camera in order to record the events and this was to take place and would have but for the leak the day or two before which ruined that investigation completely."

The case followed the notorious videotaped sting operation that culminated in Barry's arrest on drug charges at the Vista Hotel in January 1990. Beginning with his first term, the FBI, D.C. police and U.S. attorney's office scrutinized Barry's activities repeatedly, launching investigations and several stings concerning drug use, contracting, home improvements, out-of-town trips, the activities of his security detail and other issues.

Barry, who did not run for reelection last year, said yesterday he knew nothing about the investigation but that it was doomed from the start. Never in his four terms of office, he said, did he attempt to sell jobs.

"Even if he had gone through with it, it would not have worked," Barry said. "Even my enemies will concede that I don't have a reputation for taking money for providing services or help to people. If someone tried to do that, they either don't know me or are stupid."

Barry said he was not surprised that authorities continued to target him, adding: "They have tried repeatedly. Except for the Vista, they have come up empty-handed. . . . These guys--the FBI agents and their superiors--ought to be fired. To try to dig up a scheme like this is outrageous."

Barry also said that he wants Attorney General Janet Reno to investigate and that he would contact his attorneys to determine whether he has any legal recourse.

Ahn's involvement in the case began in February 1998, soon after he was arrested on charges of accepting $8,000 in bribes from operators of illegal massage parlors. A 15-year veteran of the police force and onetime officer of the year, he agreed to aid in a broader corruption probe. At the time, Ahn was the highest-ranking Asian American on the force and had won acclaim for improving police-community ties.

The unsealed court transcripts, chronicling a series of hearings before Judge Hogan in October 1998, included testimony from Yong Ahn, Azita Ahn and the FBI agents and D.C. police investigators involved in the investigation.

FBI agent William H. Spivey Jr. said authorities wanted evidence that Barry would accept a bribe in return for a city job. He said that Azita Ahn agreed to help authorities and that they created a false resume for her.

"A meeting was going to be planned through an intermediary and this resume was going to go to the intermediary along with the money," Spivey testified, saying the news leak about Ahn scuttled the operation.

Spivey and fellow FBI agent Daniel Foore testified that authorities tried to keep news of Ahn's arrest and assistance quiet within the police department because of the sensitive nature of the case. They said they did not know who leaked the story to two television stations last year.

Yong Ahn testified that investigators mentioned Barry to him immediately after his arrest. Rather than interview him at their headquarters in the District, FBI agents questioned Ahn at a field office in Northern Virginia so they could keep his arrest quiet.

Ahn testified that authorities had him contact restaurateur Tony Cheng, a Barry supporter, "and I went over several times to his business and house and eventually that led to my wife's getting to that investigation."

Azita Ahn gave this account of the plans in court: "What they were going to do was Mr. Cheng would invite Mr. Barry to his home, in Burke, in Virginia, and at that time I would wear a jacket that would have a camera or I would carry a purse into a room and set it where it would take a video of them paying Mr. Barry and I would ask for a job in D.C. government."

During her court appearance, Azita Ahn did not reveal what kind of job she was supposed to seek or how much money she was supposed to pay. One source familiar with the matter said the job was "no great shakes."

Azita Ahn testified that she feared retaliation if she cooperated but that the FBI agents reassured her. She quoted the agents as saying, "First time, they got him with a misdemeanor, he got away, but this time they would get him with a felony and he would never get away with this."

Cheng expressed shock that his name had come up in the case, saying: "The mayor cannot sell any jobs. I want to talk to my lawyer. I don't know why he mentioned my name. . . . I don't know anything about anybody getting a job."

Despite the collapse of the Barry plan, authorities said Ahn's help did generate a guilty plea from another D.C. government official. The official, who has not been identified, is awaiting sentencing, and his case remains under seal. Sources familiar with the matter said he handled business licenses for the D.C. Department of Consumer and Regulatory Affairs.

FBI agent Spivey faces his own legal problems. He was put on administrative leave last year amid allegations that he sent obscene e-mail messages and pictures to the wife of a D.C. police officer whom he arrested in a corruption investigation. Spivey, who worked in the FBI's public integrity section, has denied wrongdoing.

Staff writer Yolanda Woodlee and staff researcher Bobbye Pratt contributed to this report.