When she began her 2012 run for attorney general, she was considered a long shot, virtually unknown in political circles, but her husband put more than $2 million into her campaign.

Ms. Kane emphasized her status as the outsider and the only woman in the race. She charged that Governor Corbett, when he was attorney general, had dragged his feet for years over whether to bring child molestation charges against Jerry Sandusky, a retired assistant football coach at Penn State, who was eventually convicted.

After taking office in January 2013, she started an investigation into the Sandusky case. It did not find any misconduct in the way the case had been handled, but it uncovered thousands of emails sent by state officials with pornographic, racist or sexist content.

As Ms. Kane’s own legal fortunes deteriorated over the past two years, she released troves of bombshell emails, forcing the resignations of two State Supreme Court justices and some officials who had worked in the attorney general’s office under Mr. Corbett.

It was one of several battles she fought with the state’s mostly Republican establishment, at first earning widespread praise as well as condemnation.

In her first few months in office, she rejected Mr. Corbett’s plan to privatize management of the state lottery, refused to defend in court the state’s ban on gay marriage, offered only a lukewarm defense of a voter identification law, and exposed corruption at the Pennsylvania Turnpike Commission. She also gave a promotion to her twin sister — who had worked for years in the attorney general’s office — prompting accusations of nepotism.

In those first months, she also shut down a secret sting case that had started under Mr. Corbett and had recorded four state legislators and a judge — all Democrats from Philadelphia — accepting illegal gifts. A year later, when The Philadelphia Inquirer revealed that the operation had taken place and that Ms. Kane had shut it down, she faced claims of partisan favoritism. Ms. Kane said the cases had been mismanaged and too weak to prosecute; local prosecutors later proved her wrong, winning convictions against four of the five officials.