White House Counsel Kathryn Ruemmler is seen during the fraud and conspiracy trial of two Enron executives in 2006, in which she was the federal prosecutor. (PAT SULLIVAN/ASSOCIATED PRESS)

As soon as White House counsel Kathryn Ruemmler heard about an upcoming inspector general’s report on the Internal Revenue Service, she knew she had a problem.

The notice Ruemmler saw on April 24 gave her a thumbnail sketch of a disturbing finding: that the IRS had improperly targeted tea party and other conservative groups. She shared the news with White House Chief of Staff Denis McDonough and other senior White House aides, who all recognized the danger of the findings.

But they agreed that it would be best not to share it with President Obama until the independent audit was completed and made public, in part to protect him from even the appearance of trying to influence an investigation.

This account of how the White House tried to deal with the IRS inquiry — based on documents, public statements and interviews with multiple senior officials, including one directly involved in the discussions — shows how carefully Obama’s top aides were trying to shield him from any second-term scandal that might swamp his agenda or, worse, jeopardize his presidency.

The episode also offers a glimpse into the workings of Obama’s insular West Wing, which has struggled to cope in recent weeks with the IRS scandal, the continued fallout from last year’s deadly attack in Benghazi, Libya, and the Justice Department’s tracking of journalists as part of leak investigations.

But Ruemmler and McDonough’s careful plan for the IRS was upended on May 10, when Lois Lerner, a senior official at the agency, broke the news by admitting that the IRS had given extra scrutiny to conservative groups seeking tax-exempt status.

Senior White House officials were stunned to see the IRS trying to get ahead of its own story — and in doing so, creating a monstrous communications disaster for an administration that appeared not to know what its agencies were up to.

Ruemmler views her mission strictly as advising Obama on the law and protecting executive branch prerogatives, colleagues and friends said. “She’s a lawyer’s lawyer,” said Neal Katyal, acting solicitor general in Obama’s first term and a close friend. “She can go with you toe to toe on footnotes and Supreme Court opinions or she can get into the intricacies of protecting the president against a Capitol Hill investigation.”

Yet Ruemmler’s lawyerly focus sometimes conflicts with political imperatives. The absence of such dominant first-term personalities as former adviser David Axelrod and former chief of staff Rahm Emanuel, who could bridge those differences, has left the White House scrambling to contain its public damage.

In the IRS case, many prominent Washington lawyers say Ruemmler made the sensible legal call. She protected her client — Obama — by distancing him from a politically sensitive problem and ensuring that he could not be accused of meddling in an inquiry.

In addition, one senior administration official said, Ruemmler at the time did not know key facts: How extensive was the IRS’s targeting? How many and which employees were involved? Did they target only conservative groups and was the effort politically motivated? And were those groups’ applications for tax-exempt status denied or delayed?

To keep from intervening in the audit, Ruemmler could not seek answers, the official said.

“The single most important thing the White House counsel can do at that point is make sure no one in the White House does anything to interfere with or anything that may obstruct the conclusions from being finished and rolled out,” said Jack Quinn, who served as White House counsel under Bill Clinton.

It fell to others, including White House press secretary Jay Carney and senior adviser Dan Pfeiffer, to explain the White House’s decisions to the public, and that’s where problems arose. Inconsistencies in their stories undermined their credibility and invited scrutiny.

“It’s become a Washington spectacle,” lamented David Plouffe, a longtime Obama political adviser who left the White House in January.

Privately, other Obama allies said Carney’s repeated corrections of the official account left an impression with the public that White House aides were incompetent or hiding something.

Late last week, McDonough summoned Plouffe and a cadre of former Obama and Clinton advisers — including Stephanie Cutter, Robert Gibbs, Anita Dunn, Paul Begala and Mike McCurry — to the White House for two separate public relations strategy sessions. White House aides said they urged getting out information about the IRS situation as quickly as possible, and provided advice on refocusing attention on Obama’s jobs agenda.

The president expressed “outrage” at the IRS findings last week and acted swiftly to install new leadership at the agency. This week, however, news reports have centered on the fine points of the White House’s evolving accounts, including why Obama did not learn of the situation until the media reported it on May 10.

Plouffe — who derided the press corps as “figure skating judges” for focusing on minutiae — said the counsel’s office is routinely notified about inspector general reports. Protocol is to wait for the final reports before briefing Obama, he said.

“The truth is, there wasn’t like a playbook of 12 plays here,” Plouffe said. “The notion that somehow the counsel’s office or the White House should have leapt into action here before the IG report came out is beyond curious. That would have been the real scandal.”

As counsel, Ruemmler is a regular presence in the Situation Room and the Oval Office, making legal judgments and helping coach other senior officials on how to discuss them publicly. Internally, she is a fierce opponent of public disclosures that could expose communications within the executive branch, especially those between the president and his advisers.

“I think she’s one of the most cool-headed people in the entire White House and does a lot to ensure that nobody gets themselves in trouble,” said Cutter, who served as deputy campaign manager for Obama’s reelection bid. She added that, on the IRS inquiry, “she did the president a huge service by keeping it away from him until the IG report was final. That’s her modus operandi. . . . It makes everything that much cleaner.”

Associates say the way the IRS situation was handled fits with Ruemmler’s approach to making decisions: wary to act before knowing all the facts, but then decisive once they are clear.

“She’s very deliberate,” said Akin Gump lawyer John M. Dowd, a friend. “There’s no reason to go busting into it. . . . Even though it’s a hot subject and there’s going to be some political implications, to me you wait until you’ve got a work product in your hands.”

Unlike most senior White House aides, Ruemmler has no campaign experience. Although she has worked in Washington for years, as a prosecutor and as a litigation partner at Latham & Watkins, former colleagues said she showed little interest in politics.

Clinton White House counsel Lanny Davis said Ruemmler lacks political and media savvy. He said she had “an obligation to give the president a heads-up and generally describe what might be coming down the track [on the IRS] so you can do crisis management planning.”

Plouffe rejected that criticism, saying, “I know blowhards like Lanny Davis have posited this question, but they’re dead wrong.” Obama, he said, has “plenty of people who give him political advice. He needs a top-flight lawyer who’s going to run a good process, and that’s what she’s done.”

Beth Wilkinson, a Washington lawyer and former Justice Department official, said Ruemmler’s focus on the law is considered a virtue inside the White House.

“She stays in her lane, which people appreciate,” said Wilkinson, a close friend of Ruemmler’s. “She really sees her role as the counsel to the president and to protect the presidency and provide legal advice. She doesn’t try to do other people’s jobs.”

Discuss this topic and other political issues in the politics discussion forums.