A former FBI counterintelligence supervisor pleaded guilty yesterday to lying about a long-running sexual affair he had with a prized bureau informant now accused of spying for China.

In a plea agreement that could keep him out of jail, James J. Smith appeared before a federal judge in Los Angeles and admitted that he had concealed his affair with Katrina Leung during a routine FBI background review in 2000.

Smith, 60, agreed to cooperate with the government's ongoing investigation into Leung's suspected 20-year penetration of FBI counterintelligence efforts, which could include testifying against her if she is tried next year. In exchange, charges involving mail fraud and mishandling of classified documents against Smith will be dropped.

By agreeing to the unusually light sentence, officials said, the government hopes to build a stronger case against Leung, speed its damage assessment and avoid having to air more national security information during a trial.

Leung's suspected spying has been a blow to the FBI's troubled national security division, which previously failed to detect that counterintelligence agent Robert P. Hanssen sold secrets to the Russians for 20 years. Hanssen was arrested in 2001 and is serving a life sentence.

The Leung case also has forced the U.S. intelligence community to rethink much of what it thought it knew about Chinese intentions.

Leung, a Chinese American recruited by Smith in 1982, quickly became one of the intelligence community's most valued Chinese assets, one with contacts in the top ranks of the Chinese government. Code named "Parlor Maid," she brought the FBI information about Chinese military and intelligence capabilities, political intentions, and efforts to influence U.S. electoral politics that was circulated to presidents and foreign leaders. All of it is now suspect.

A special FBI inspection team also has been trying to assess what influence she may have had on Chinese espionage cases, including two high-profile probes involving Smith that foundered badly: the nuclear secrets investigations of Los Alamos scientist Wen Ho Lee and TRW Inc. contractor Peter H. Lee. Wen Ho Lee, who spent nine months in jail, pleaded guilty to a single felony after the government's case crumbled. Peter Lee confessed in 1997 to transferring classified material to China but served no jail time.

Leung, who was paid $1.7 million by her FBI handlers, had an off-and-on sexual relationship with another former FBI counterintelligence agent during some of the years that she was involved with Smith. William Cleveland Jr., formerly an agent in San Francisco and then security chief at Lawrence Livermore National Laboratory, has cooperated with investigators and was not charged in the case.

Smith, accompanied by his wife and grown son, said little in the courtroom beyond his admission of guilt. His attorney, Brian Sun, said afterward that Smith is barred under the terms of his agreement with prosecutors from talking to the media until Leung's case is resolved.

"He's acknowledged he had a relationship he probably shouldn't have had on duty because he was having a relationship with an asset," Sun said. But, he asserted that "this plea confirms he did not engage in any conduct that jeopardized national security."

Four remaining counts of the indictment against Smith will be dismissed when he is sentenced in January if the government is satisfied with his cooperation. He faces a maximum penalty of five years in prison, but U.S. District Judge Florence-Marie Cooper said she did not "anticipate this punishment will be imposed in this case." Smith, who retired at 57, also will be allowed to keep his FBI pension.

In addition to not telling the bureau of his affair with Leung, Smith also was accused of withholding his discovery in 1991 that the Chinese government knew that the FBI had her on its payroll as an informant.

Counterintelligence agents in San Francisco discovered that Leung had had unauthorized conversations with a Chinese intelligence official. Smith, her handler, was notified and a meeting was held at FBI headquarters. In charging Smith, the government said he did not reveal then or later that he was sexually involved with Leung.

When Smith confronted Leung about the conversations with the Chinese official, according to court papers, Leung told him she had passed "secret unauthorized communications" to the Chinese, something he did not then tell the bureau.

Smith was accused of taking classified documents to Leung's home, where she gained access to them and copied them. They included a document related to the espionage investigation of Peter Lee, whose plea agreement with authorities, which involved no jail time, was later questioned by members of Congress.

In a written statement yesterday, Leung's attorneys, Janet Levine and John Vandevelde, said: "Although we may have to fight to the end because the FBI has tried to protect its own and shift blame for their mistakes to Katrina, an outsider, a Chinese American and a woman, we are confident that this case is much ado about nothing and Katrina Leung will be vindicated."

Leung is charged with copying national security documents and unauthorized possession of those documents. Her attorneys have said they plan to take advantage of limitations imposed on the government by national security concerns.

"We expect the government will have to make hard decisions about whether to publicly disclose 20 years worth of spying secrets in order to pursue an ill-advised prosecution," the defense team said in a statement last year.

Edds reported from Los Angeles.

Retired FBI agent James J. Smith departs a courthouse last May in Los Angeles. Smith has agreed to cooperate in the government's case against his ex-lover, Katrina Leung, an informant accused of spying.