A Montgomery County judge on Monday ordered Pennsylvania Attorney General Kathleen G. Kane to stand trial on criminal charges after a hearing in which one of Kane's most trusted aides testified against her, and the judge repeatedly rejected her legal arguments.

Prosecutors say Kane, a Democrat who is the state's top law enforcement officer, broke the law by orchestrating a leak to a newspaper reporter in a bid to embarrass a foe, and then lied about it under oath. Using Kane's testimony before the grand jury that investigated the leak, prosecutors attempted to show that she repeatedly lied in an effort to cover up her actions.

They called David Peifer, a special agent in the Attorney General's Office, who was a member of Kane's inner circle. Peifer, the first witness to take the stand, described meeting with Kane in March 2014 and giving her information she is charged with leaking to the press.

Kane's lawyers raised several objections that District Judge Cathleen Kelly Rebar overruled, including blocking their effort to delve into pornographic emails exchanged by top prosecutors who worked for Kane's Republican predecessors.

When Kane's lead lawyer, Gerald Shargel, mentioned the emails, Rebar cut him off, saying he was moving far afield from the issue at hand: whether Montgomery County prosecutors had enough evidence to take the case against Kane to trial.

After the hearing, Shargel declined to explain what he viewed as the significance of the emails or their link to the charges against Kane.

"I am not going to explain the connection," he said, adding that he was not going to try the case in the media.

Kane has maintained that her discovery of years' worth of pornographic emails circulated on state computers inside the Attorney General's Office earned her enemies with a powerful motive to discredit her in an effort to protect their reputations.

Kane, 49, is charged with a felony count of perjury and seven misdemeanor charges, including conspiracy, obstruction, official oppression, and false swearing. The maximum penalty on the perjury conviction alone is seven years in prison.

Kane, the first woman to be elected attorney general, has insisted she is innocent and has rebuffed calls for her resignation from Gov. Wolf and other top Democrats.

The attorney general did not speak to reporters as she made her way to the courtroom in a sleeveless tangerine dress. She was preceded by her twin sister, Ellen Granahan Goffer, who was quickly surrounded by television cameras and a throng of reporters and photographers, only to have them pull back when Kane appeared behind her.

Prosecutors say Kane illegally leaked secret grand jury information to the Philadelphia Daily News in an attempt to plant a story to embarrass a critic, then lied to a grand jury when questioned about her actions under oath.

Prosecutors say Kane ordered Patrick Reese, the head of her security detail, to spy on emails to try to determine whom among her staff was cooperating with the investigation into the leak.

Reese, charged with contempt of court for allegedly violating a court order protecting witnesses in the inquiry, is to be tried separately. He has pleaded not guilty.

In a 42-page document laying out the case against Kane, Montgomery County District Attorney Risa Vetri Ferman, a Republican, contended that Kane was irate and determined to get vengeance after The Inquirer published a story critical of her in 2014. The newspaper revealed that Kane had shut down an undercover sting investigation that had caught several Philadelphia Democrats on tape taking money or jewelry from a lobbyist.

The city's district attorney, Seth Williams, resurrected that inquiry and has won four convictions. Two more cases are pending.

Ferman said Kane blamed Frank Fina, a former top corruption prosecutor on her staff, for the sting story, and leaked secret grand jury information to the Daily News to get even with him.

The Daily News story suggested that Fina failed to aggressively pursue a criminal investigation into the financial dealings of then-Philadelphia NAACP leader J. Whyatt Mondesire in 2009. Fina has said the story, which dredged up a long-shuttered case, raised groundless allegations against him.

On Monday, Shargel attempted to introduce additional news articles about Mondesire, and argued that the former NAACP leader's reputation had not been damaged by the 2014 article, as prosecutors allege, because earlier news reports had raised similar questions about him.

"You can't destroy it a second time," Shargel said.

"Quite frankly, your honor, this is absurd," countered Michelle Henry, a Bucks County prosecutor specially sworn to try the case with Montgomery County First Assistant District Attorney Kevin Steele.

Rebar sided with the prosecution, saying a jury could decide whether the leak created further damage to Mondesire's reputation. She also overruled the defense claim that it did not have adequate time to review documents before the hearing.

Shargel attempted to undermine the prosecution's contention that Kane was motivated to leak information about Mondesire to embarrass Fina. He suggested that Kane knew months before the Daily News story was published that Fina had been a participant in the pornographic email exchange and yet did nothing to expose it.

Prosecutors declined to comment on Shargel's assertion, which Rebar said was not relevant at this stage.

In an interview Monday, Fina said, "I learned a long time ago not to respond to the claims of criminal defendants and their lawyers."

Prosecutors declined to say whether Peifer, who oversees special investigations under Kane, had become a cooperating witness, or whether he had been given immunity to testify against Kane.

In the affidavit laying out the charges against Kane, prosecutors identified Peifer and Reese as having spied on the grand jury investigation at Kane's direction, but only Reese has been charged.

Peifer said he gave Kane a key document that ended up being given to the Daily News, and was quoted in the story about the investigation of Mondesire. Kane has testified that she did not authorize the release of specific documents and that she did not know details about how they were delivered to the newspaper.

Kane also has said that she had never seen a key investigative document quoted in the Daily News story until it was shown to her during her grand jury appearance last November. But Peifer testified that at Kane's request, he arranged for his administrative assistant to email the attorney general the document last summer.

The other witness, Paul Bradbury, the lead detective in the leak case, was asked Monday to read aloud from grand jury testimony and summarize interviews with key players in the investigation.

Steele, the lead prosecutor in the case, said the case likely would not go to trial until early next year.

Kane is the first attorney general since Republican Ernest Preate Jr. to face criminal charges. Preate, a Republican, resigned in 1995 in the third year of his second term, and served a year in prison after pleading guilty to fraud related to an illegal campaign contribution.

Of the 93 attorneys general of Pennsylvania since 1776, Kane is the third woman in the job and the first to be elected. Previously, Linda Kelly served as an appointed attorney general to fill a vacancy between 2011 and 2013. Also, Anne X. Alpern was appointed in 1959 and served until 1961.

Inquirer staff writer Laura McCrystal contributed to this article.