At the end of Kathleen G. Kane's first week as Pennsylvania attorney general, she sent an exuberant email to her new staff.

"Together, as a team," she wrote, "I look forward to working with you to do the people's business."

The praise flowed back.

"I have been a deputy attorney general for over 21 years," one state prosecutor wrote, "and this is the first word of inspiration from an attorney general that I can recall."

Kane replied: "Omg. I had a tear in my eye."

The following year, Kane's mood was decidedly less sentimental as she absorbed the first in a series of blows that transformed her image and would eventually lead to her arrest, the suspension of her law license, and a narrow escape from a legislative effort to oust her.

For Kane, the game changer was an article in The Inquirer published March 16, 2014, disclosing that the previous year she had secretly shut down a corruption investigation that caught elected officials on tape pocketing cash.

Within days, Kane had hired prominent Philadelphia lawyer Richard A. Sprague to pursue a possible defamation lawsuit.

His role, she wrote then in an March 20 email, was to investigate "whether others may have supplied the paper w lies. As such, he will dig into the whole story of who is supplying the defamatory info and why."

Kane added: "I will not sit back and let them tarnish my good reputation."

She hit the "send" button at 11:39 p.m.

That email message and thousands of others Kane had sent and received since taking office were made public last week by the Attorney General's Office.

In response to public-records requests filed by the Associated Press and later by The Inquirer, Kane's office released 5,000 pages of emails from two of Kane's personal accounts - one on yahoo.com, the other on aol.com - to staffers, political and media consultants, and others between 2013 and 2015.

Kane spokesman Chuck Ardo said Friday that he was unsure whether Kane was involved in the decision to release the emails. With a suspended law license, she is barred from making legal decisions.

Ardo said Kane had no objection to the release, however, and had "nothing to hide."

Many of the messages deal with the brass tacks of running an 800-employee law enforcement agency, reflecting the care and tending of Kane's schedule, the drafting of news releases, court filings, and the like. Information was blacked out in some of the messages to exclude personal information pertaining to others and information that would have revealed deliberations on unresolved legal matters, Kane's office said.

None of Kane's personal emails dealt with her criminal case. Nor did the material include emails sent or received by Kane on her official attorneygeneral.gov email address, so they do not give a complete picture of her communication with others.

Still, the messages pull back the curtain on Kane's actions as she and her advisers mulled her damaged image and dealt with stresses that grew month by month.

They show that within weeks of taking office, Kane was already venting about two men who would emerge as her biggest political nemeses: former state prosecutor Frank Fina and Philadelphia District Attorney Seth Williams.

As the attorney general and her advisers strategized about how to respond to unflattering media coverage in the fall of 2014, political adviser J.J. Balaban, a partner in the Campaign Group, pushed Kane to hire a "strong communications director" to drive home her positions.

By this point, Kane had gone through about half of the eight press secretaries hired during her tenure.

"The press isn't always quick on the uptake so they need to be told the same things over and over again," Balaban counseled.

He also had another suggestion: enlisting former Gov. Ed Rendell to meet with Inquirer editor William K. Marimow to make the case that the paper had excessively focused on Kane as compared with other public figures.

He recommended that Rendell say "mistakes have been made on both sides and there needs to be a different approach from both sides moving forward."

Such a meeting never took place.

Balaban weighed in again when Kane misspoke at a news conference in summer 2014 and asserted that Fina had failed to bring charges on behalf of a victim of child rapist Jerry Sandusky. Her staff later had to correct her remark.

Referring to Kane by her initials, Balaban said the staff needed to push back against her critics.

"Guys, this is really, really simple. And it is virtually important that this get out the door - they are saying that KGK is a liar and crazy - it must be refuted by people other than KGK swiftly," he said.

The result was a public statement by four top aides defending Kane.

The email traffic also shows that Kane viewed both Fina and Williams coolly from the start of her tenure - well before her relationship with the two exploded into open warfare.

In the spring of 2013, Kane and her top aides complained that Williams had not given them advance notice of a news release touting the arrest of a gun trafficker. The arrest was made by a joint task force composed of detectives from Williams' office and Kane's.

Williams' staffers said they had lost track of their contact in Kane's agency.

"That's bull," Kane responded in an email to one of her aides.

She called it Williams' "Strike 2." It is unclear what Strike 1 was.

An aide replied that the day might come to "blow Seth out of the water - a fun option."

It got worse in 2014, after Williams openly criticized Kane's decision to drop the sting case. Her aides noted with some relish that Williams, too, had chosen not to prosecute a particular criminal case.

They discussed a newspaper story reporting that Williams had declined to prosecute abusive police who had been the subject of a series of stories in the Philadelphia Daily News.

"Seth is a political animal," Kane wrote press aides on April 25, 2014. While declining to bring charges in that case, she said, he "chooses to second guess me."

She added: "Shame on that politician with no respect for women."

The emails made it plain that Kane quickly adopted a derisive attitude toward Fina as well.

Her animosity was apparent well before she blamed him for the criminal charges she now faces. Kane is awaiting trial on charges of perjury, obstruction, and other crimes. Prosecutors say she leaked grand jury information to the Daily News in a bid to plant a story to embarrass Fina, whom she blamed for the Inquirer story that revealed the aborted corruption probe.

In mails circulating less than three months after Kane took office, she responded to a story in the Legal Intelligencer raising questions about her decision to hire a law professor to review how Fina had investigated Sandusky, the former assistant football coach at Penn State.

With a practiced air, Kane critiqued the Intelligencer story.

"It was a slow news day and this reporter was played by the source," she said.

She added: "I do not have to defend myself . . . Fina got his 15 minutes."

In 2014, as the dispute between Kane and Fina erupted into public view, the emails show how Kane's outside press consultants urged her to paint Fina as someone who would not acknowledge any missteps.

"Focus on how Team Fina basically won't admit they could've done anything better," Balaban wrote in a June 24, 2014, email to Kane.

"Go on offense . . . Their position is hard to defend. It would be helpful to go through their press conference and compile some of their quotes in which they basically deny any errors."

On Aug. 7, 2015, the day after Kane was charged in her criminal case, her spokeswoman forwarded her an email with the subject line "yay!" It contained transcribed voice mails from callers who supported Kane.

"Here is some of the interesting/positive calls I have gotten so far for the General," Kane's secretary wrote.

Among the messages:

"Don't let her quit, because what she is fighting is unreal. . . . we have to get rid of all this corruption. . . . What's real is Kathleen Kane."

cmccoy@phillynews.com

215-854-4821@CraigRMcCoy

Staff writers Mark Fazlollah and Dylan Purcell contributed to this article.