The final act of the Kathleen Kane drama is at hand.

Almost four years after her landslide victory to become Pennsylvania's first Democratic attorney general, and after her popularity collapsed amid reports of dropped criminal cases and vendettas against enemies, Kane is to go on trial Monday on a dozen counts of perjury, official oppression, and other crimes.

Kane says she is being railroaded by a male power structure intent on hiding its exchanges of pornography and looking out for each other.

Prosecutors say Kane was a reckless political neophyte bent on revenge and heedless of the law and the damage she was doing. They say she unlawfully leaked grand jury secrets and then lied about it under oath.

Kane admits she leaked confidential material to plant a negative story that embarrassed a former prosecutor in her office. But she insists the leak was lawful.

The trial, at the Montgomery County Courthouse in Norristown, will pit Kane, 50, against at least four former allies - two ex-aides, a political consultant, and a current aide who has been given immunity from prosecution in exchange for his testimony.

The four are expected to face tough cross-examination from Kane's lead lawyer, Gerald L. Shargel, who won headlines in New York City for his representation of organized-crime boss John Gotti and his slashing questioning of mob turncoats.

Kane's skid in political fortune - and her criminal troubles - began in March 2014, in her second year in office.

That month, the Inquirer reported she had secretly shut down an undercover sting investigation the year before, bringing no charges against six Philadelphia Democratic officials caught on tape pocketing cash, and, in one case, a $2,000 Tiffany bracelet. (Philadelphia District Attorney Seth Williams later resurrected the case and, so far, has won five convictions.)

The article was Kane's first real experience with bad publicity. She was incensed at the story and blamed a former state prosecutor, Frank Fina, for leaking it.

To get even, prosecutors say, Kane gave Fina what she saw as a taste of his own medicine. She arranged for the leak of secret grand jury materials to suggest that Fina had looked the other way during a 2009 investigation of Philadelphia civil rights leader J. Whyatt Mondesire. The result was a story critical of Fina that was published in the Philadelphia Daily News in June 2014.

As they have investigated Kane's actions, prosecutors and detectives have learned about a fierce debate in her fractured office about the ethics of the leak even before it occurred, the convoluted path by which Kane routed the material to the Daily News and her nonchalant reaction when her appalled staff learned of the leak.

A key prosecution witness is to be former first deputy Adrian King, once one of Kane's most stalwart allies and someone she dated when both were students at Temple law school.

In potentially devastating evidence, investigators have obtained an email King sent his boss shortly before the leak warning her not to give out confidential information.

King also told a grand jury that when he attended a war council at which Kane plotted the leak, his reaction was "This is nuts . . . I don't want anything to do with it."

Nonetheless, prosecutors say, on April 22, 2014, Kane asked King to deliver a package from Harrisburg to a political consultant in Philadelphia, Josh Morrow.

King agreed to do that. He found the package on his desk in the Capitol and departed with it.

In a whodunit sure to be highlighted by Kane's lawyers, investigators have never been able to say who put the package together and placed it in King's office. Kane says it wasn't her.

As for King, he insists Kane never told him what he was delivering and says he never asked. He said he assumed the package held routine campaign handouts and never took a peek inside. In fact, the package was full of investigative material about the grand jury investigation of Mondesire.

It is undisputed that Morrow, once he got the material from King, carried out the final leg of the transfer, handing the material to a Daily News reporter.

While admitting she wanted to get information about Fina and Mondesire to the Daily News, Kane is expected to argue that she left the actual selection of what material to share to others. She is expected to say that if laws were broken, others were the guilty parties, not she.

To undermine that, prosecutors are expected to call Kane aide David Peifer, who was granted immunity. Peifer has said he handed Kane a key investigative document at the meeting at which the leak was hatched.

"She was flipping through and looking at it," Peifer testified before an investigative grand jury. The document and others eventually made their way to the Daily News.

In her sworn testimony to the same grand jury, Kane acknowledged she called Morrow while King was on his way to him with the leak. But she insisted she merely told him, "Josh, Adrian wants you to call him."

Prosecutors say this was a lie, calculated to vastly minimize her role.

Telephone records, King's testimony and Morrow's statement" show that Kane had a far more extensive conversation with Morrow, prosecutors say.

In a statement to investigators, Morrow said that in fact, Kane told him in detail that she wanted him to deliver material about Mondesire and Fina.

Perhaps even more damning, in a stroke of bad luck for Kane, Morrow was picked up on an FBI wiretap on the very night that he agreed to deliver the leak to the Daily News.

In pretrial motions, Kane sought to bar the playing of the tape at her trial, but Montgomery County Judge Wendy Demchick-Alloy said she will permit it if the defense attacks Morrow.

The 2014 tap had been set to tape not Morrow, but a political friend on the other end of the call. The friend was caught up in an unrelated federal investigation of former state Treasurer Rob McCord.

"Two friends gossiping," was how a Kane lawyer described the call.

As it happened, though, the chatter included a discussion of the leak - and Kane's role in it. On the tape, according to court documents, Morrow said Kane told him what was in the packet and how it was aimed at hurting Fina. This contradicts Kane's sworn testimony.

Still, the tape may prove a double-edged sword. According to people familiar with it, Morrow also told his friend that King, too, was also well aware of what was in the package - a statement that Shargel might seek to use to impeach King.

Morrow's changing stories may also limit his effectiveness for the prosecution.

According to court papers, he originally backed up Kane, telling investigators that King, not the attorney general, was a driving force behind the leak.

Later, Morrow reversed course.

"Upon further reflection and research," as special prosecutor Thomas Carluccio put it in a court document, he no longer contended that King was in on the leak. As for Kane's role, he took the Fifth.

But Carluccio, battered that wall down. He won a quick ruling from the state Supreme Court that stripped away Morrow's ability to invoke the privilege against self-incrimination.

Since Morrow faced no criminal charges for his role in the leak, he had to talk or be jailed for contempt, the high court ruled.

In a second reversal, Morrow landed on his final position: that Kane was deeply involved in the leak, briefing him on exactly what the plan was.

When the Daily News published the article about Fina and Mondesire, it stirred panic and anger within Kane's office. Much of Kane's top command - Peifer, grand juries chief James Barker, and top aides Linda Dale Hoffa and Bruce Beemer - later told investigators they instantly saw the story as based on a leak of confidential documents.

Hours after the article appeared, Beemer, who had just replaced King as first deputy, called Kane to ask for permission to investigate. She did not reveal to him that she was the leaker.

"Don't worry about it," Beemer has said Kane replied. "It's not a big deal. We have more important things to do."

One thing that won't be explored during the trial is Kane's contention that the case against her was "corruptly manufactured" to punish her for her crusade against the swapping of pornographic emails among lawyers and judges using state computers.

Prosecutors said Kane's argument was a "red herring," and Demchick-Alloy has barred lawyers in the case from pursuing the issue.

It's unclear whether Kane or Fina will testify.

After months of silence about the Daily News story, Kane finally acknowledged that she had been the source for it. She did so in November 2014 in a public statement moments before testifying before the grand jury investigating the leak.

In that testimony, Kane marshaled another key argument about why she should not face criminal liability for the leak. She said she had been a "stay-at-home mom" in 2009 when the Mondesire case was active and thus signed no secrecy oath binding her to keep the investigation confidential.

That argument came unglued nearly a year later when detectives found precisely such an oath signed by Kane.

It turned out that during her first week on the job in 2013, Kane formally pledged that she would keep secret investigations launched before she took office.

The discovery prompted prosecutors to file a second felony charge of perjury against her.

Shargel, Kane's lawyer, has said she had not knowingly lied, but rather forgotten - a lapse he called "an innocent mistake."

To buttress that argument, Shargel may point out that Kane was among five top officials who signed secrecy oaths that week - yet none stepped up to alert Carluccio about that.

On the other hand, prosecutors may argue that Kane's signature on that oath was no mundane event. She affixed her signature to the oath after a clash with Fina in which he complained that she had surreptitiously seized his computer hard drive to examine its contents - without the necessary security clearance of a signed secrecy oath.

If convicted of the felony perjury charges, Kane faces a maximum jail term of seven years. The other charges - misdemeanors - carry a maximum sentence of two years.

Kane, who is not seeking reelection, could also lose her law license if she is found guilty.

cmccoy@phillynews.com215-854-4821 @CraigRMcCoy