A federal judge Thursday dismissed all charges against a Chinese-American woman accused of using a sexual affair with an FBI agent to gain unauthorized access to classified documents.

U.S. District Judge Florence Marie Cooper dismissed the case for prosecutorial misconduct, finding that the government had purposely made sure that Katrina Leung (search), a socialite with extensive China contacts, would not have access to her former lover, James J. Smith (search), for information regarding her case.

Smith, Leung's FBI "handler" for many years, has pleaded guilty to a single count of making a false statement about the affair and agreed to cooperate with the government. He had been accused of mishandling classified material and allowing it to fall into Leung's hands.

Leung, of the Los Angeles suburb of San Marino, allegedly took the documents from his briefcase. She was not accused of transmitting them to China.

U.S. attorney's spokesman Thom Mrozek said prosecutors strongly disagree with the ruling but had not decided how to respond.

"While litigating this motion we argued the government did not prohibit Mr. Smith from speaking to Ms. Leung's attorneys if he chose to do so," he said.

The government could drop the case, ask Cooper to reconsider or take the issue to the 9th U.S. Circuit Court of Appeals (search).

Leung would have faced up to 14 years in prison had she been convicted of illegally copying and possessing national security papers that she intended to use, or could have used, to harm the interests of the United States.

"The government decided to make sure that Leung and her lawyers would not have access to Smith," the judge said in her decision. "When confronted with what they had done, they engaged in a pattern of stonewalling entirely unbecoming to a prosecuting agency."

Leung's lawyers, Janet Levine and John Vandevelde, said in a statement that "the courts have again made sure that truth and justice are not mere platitudes."

"She's gratified and excited about moving on with her life," Levine said of Leung. "She's reminded again about why this is such a great country."

The judge was sharply critical of the conduct of Assistant U.S. Attorney Michael Emmick and Robert Wallace, senior trial counsel with the Department of Justice counterespionage section.

Wallace sent an e-mail to Emmick suggesting they could not trust Smith to be interviewed by the defense and abide by his agreement to protect classified information. It also suggested they would be giving the defense a strategic advantage.

"In the face of that e-mail, anything short of an admission and apology on the part of the government is difficult to imagine," the judge said.

The judge said Emmick filed a legal response six days after receiving the e-mail in which he continued to assert that "the government never intended to prohibit Smith from being interviewed by Leung's counsel."

Mrozek said Smith had not been secreted away to keep him from talking to Leung's defense. "He's not hidden anywhere," he said. "To my knowledge they never even asked to conduct an interview with him."