President Obama with John O. Brennan in 2012. At the White House, Mr. Brennan managed the “kill lists” for drone strikes. Credit Pete Souza/The White Hous.

WASHINGTON — Just hours before he publicly responded last week to the Senate Intelligence Committee report accusing the Central Intelligence Agency of torture and deceit, John O. Brennan, the C.I.A.’s director, stopped by the White House to meet with President Obama.

Ostensibly, he was there for an intelligence briefing. But the messages delivered later that day by the White House and Mr. Brennan were synchronized, even down to similar wording, and the larger import of the well-timed visit was hardly a classified secret: After six years of partnership, the president was standing by the embattled spy chief even as fellow Democrats called for his resignation.

That’s not to say there was no friction between the West Wing and the C.I.A.’s Langley, Va., headquarters after the release of the scorching report. Irritated advisers to Mr. Obama believe Mr. Brennan made a bad situation worse by battling Democrats on the committee over the report during the past year. Some who considered Mr. Brennan the president’s heat shield against the agency when he worked in the White House now worry that since being appointed director, he has “gone native,” as they put it.

But in the 67 years since the C.I.A. was founded, few presidents have had as close a bond with their intelligence chiefs as Mr. Obama has forged with Mr. Brennan. It is a relationship that has shaped the policy and politics of the debate over the nation’s war with terrorist organizations, as well as the agency’s own struggle to balance security and liberty. And the result is a president who denounces torture but not the people accused of inflicting it.

“The quandary that Brennan faces is similar to the quandary that Obama faces,” said David Cole, a national security scholar and law professor at Georgetown University. “Both are personally opposed to what went on and deeply troubled by what went on and agree that it should never happen again. And both are ultimately dependent on the C.I.A. for important national security services.”

Indeed, rather than give his own speech on the report’s accusations against the C.I.A., Mr. Obama left it to Mr. Brennan to be the administration’s public face. “It is fairly remarkable that the lead responder here is the director of the C.I.A.,” said Daniel Benjamin, the State Department’s top counterterrorism official during Mr. Obama’s first term and now at Dartmouth. “But that may be a reflection of the administration’s original decision to cordon off the issue and not have a broader partisan blood bath over the Bush White House’s involvement in torture.”

In responding to the report, Mr. Brennan walked a line between his president and his agency. He again embraced Mr. Obama’s decision after taking office to ban interrogation techniques like waterboarding, nudity and sleep deprivation. But he criticized only the “limited number” of C.I.A. officers who exceeded broad Justice Department rules governing interrogations.

And he flatly rejected the committee’s contentions that the interrogation program was not central to thwarting terror plots and that the agency had misled the public about its effectiveness, although he said it was unknowable whether detainees talked specifically because of the brutal methods.

Current and former colleagues said Mr. Brennan had an institutional responsibility to guard his building. “If John were retired and had a few drinks in him, he might have a different tone to him,” said William M. Daley, Mr. Obama’s former chief of staff. “But he can’t, nor should he, do anything other than what he’s done.”

Changing Roles

But guarding the building is a markedly different role than Mr. Brennan played as Mr. Obama’s counterterrorism adviser in the first term, when he helped recalibrate the terror war by trying to close the prison at Guantánamo Bay, Cuba, and by reining in perceived excesses. “On all of the debates, he was on our side on almost all of them,” said a former White House official, who like others did not want to be named describing internal deliberations.

Mr. Brennan, 59, who spent much of his career as an Arabic-speaking C.I.A. officer, has been a central figure in Mr. Obama’s world since the beginning of his presidency. Built like a linebacker, with a hardened face, close-cropped retreating hair and an intense gaze, Mr. Brennan looks the part of a grim counterterrorism agent. More than one Obama aide compared him to a grizzled city cop, and all of them testified to his herculean work ethic.

A native of North Bergen, N.J., Mr. Brennan attended Fordham University, spent time in Indonesia and Egypt and earned a master’s degree in Middle East studies at the University of Texas at Austin before answering a newspaper ad for the C.I.A. He rose through the ranks to become station chief in Saudi Arabia and a favorite of George J. Tenet, then the C.I.A. director, who made him his chief of staff and later the agency’s deputy executive director.

“He was a pretty good analyst. He was a bright guy,” said Melvin A. Goodman, a former C.I.A. officer who is now a senior fellow at the Center for International Policy and a sharp critic of the agency. “But he always had a reputation of sucking up to power and moving in the direction of power and not being able to exercise any independence.”

After the attacks of Sept. 11, 2001, Mr. Brennan helped set up the Terrorist Threat Integration Center, later reorganized as the National Counterterrorism Center. But he was not made its permanent director and, disaffected with President George W. Bush’s administration, he retired from the C.I.A. in 2005 and became a public critic.

Brought into Mr. Obama’s orbit, Mr. Brennan was the new president’s first choice to become C.I.A. director, but that unraveled when Democrats protested his association with Mr. Tenet’s leadership. Mr. Brennan has said he opposed waterboarding during Mr. Bush’s tenure, but not every brutal interrogation method. In 2007, he told The New Yorker that the United States would “be handicapped if the C.I.A. was not, in fact, able to carry out these types of detention and debriefing activities.”

After Mr. Obama’s election, Mr. Brennan argued that he had not been part of the interrogation program and “opposed different aspects” of it while concurring with others. He acknowledged that he had once argued for keeping open the secret C.I.A. prisons but that conditions had changed and “I’ve changed my views.”

A Relationship Deepens

In the end, he had to settle for the White House job, but that may have worked out better for him because it sealed his relationship with Mr. Obama, a former law school instructor with little national security background. “Somebody like the president, who doesn’t have that background, will end up gravitating to someone who does,” Mr. Daley said.

Whether it was a would-be underwear bomber or shootings at Fort Hood, Mr. Brennan exuded a confident competence that reassured a new president and his staff. “I slept better knowing that John Brennan never does,” recalled David Axelrod, then Mr. Obama’s senior adviser. Another former aide described Mr. Obama and Mr. Brennan as “kindred spirits.”

In a low-ceilinged, windowless basement office next door to Denis R. McDonough, who would later become White House chief of staff, Mr. Brennan was entrusted with an outsized role running the war on terrorist groups. He managed “kill lists” for drone strikes and could order air attacks in Yemen without getting further approval from the president. “Brennan’s control over his area was as complete as anyone’s control over anything in the White House,” another former senior official said.

He came to be identified with the escalation of America’s secret war in Yemen and the successful raid that killed Osama bin Laden, but he was also an ally of those resisting more hawkish policies in Afghanistan and Libya, and advocated freeing wrongly held detainees at Guantánamo.

He also made it easier for the president to restrain C.I.A. adventures; he could grill the agency as no other Obama adviser could. “He understands them intimately and was constantly raising hard and tough questions,” said Harold Koh, then the State Department’s legal adviser and now a Yale Law School professor.

But neither Mr. Obama nor Mr. Brennan was eager to take on the C.I.A. too often. “The C.I.A. gets what it needs,” Mr. Obama declared at one early meeting, according to people there. “He didn’t want them to feel like he was an enemy,” said a former aide.

Fighting an Inquiry

Mr. Brennan likewise was protective of C.I.A. interests. He tried to excise the word “torture” from White House documents, only to be overruled. And when Leon E. Panetta, who became Mr. Obama’s C.I.A. director, negotiated an agreement with the Senate Intelligence Committee for an inquiry into torture, Mr. Brennan erupted. “It did not take long to get ugly,” Mr. Panetta recalled in his memoir. “Brennan and I even exchanged sharp words.”

Mr. Brennan could not reverse the deal, but since becoming C.I.A. director last year he has fought constantly with Democrats on the committee over the torture report. During one meeting, Mr. Brennan grew red-faced and pounded his fist on a table. “The C.I.A. is not a rogue organization,” he declared.

Relations worsened when senators accused the C.I.A. of penetrating a computer network designated for the committee’s use and reading staff emails to find out how the committee might have obtained an internal C.I.A. study of interrogations ordered by Mr. Panetta when he was director. The C.I.A. inspector general admonished five agency officers and Mr. Brennan apologized, but relations remained raw.

Senator Carl Levin, a Michigan Democrat on the committee, said on Saturday that he had yet to receive answers about Mr. Brennan’s exact role in the episode.

“To stonewall about getting information about what he knew and when he knew it is really unacceptable,” he said. “Brennan has gotten away with frustrating congressional oversight. He shouldn’t have gotten away with it, but so far he has.”

Several Obama advisers said privately that Mr. Brennan made a mistake by letting the situation grow so toxic. In October, Mr. McDonough flew to California to smooth things over with Senator Dianne Feinstein of California, the committee chairwoman, and negotiate redactions to the torture report.

Last week Mr. Brennan became the agency’s prime defender, much to the chagrin of some of the president’s allies.

“There’s a difference between loyalty and leadership,” said Elisa Massimino, president of Human Rights First, an advocacy group. “Brennan may be showing loyalty to the agency by trying to make sure none of his people are in legal peril. Leadership would be if he used this crisis as an opportunity to make clear what the standards are going forward.”

As for Mr. Obama, advisers said they doubted he believed the interrogation program yielded useful intelligence but that he was unwilling to publicly contradict Mr. Brennan. Instead, the president made sure the C.I.A. got what it needed: cover against its critics.

Michael V. Hayden, the former C.I.A. director who has led the public defense against the Senate report, said he “deeply appreciated” Mr. Obama’s measured words about the tough choices his predecessor faced after Sept. 11 and his praise for the “patriots” of the C.I.A.

“Given what he’s said in the past,” Mr. Hayden said, “this is about the best we could have hoped for.”