Mike Pompeo didn’t always seem content playing the traditional role of a C.I.A. director. The former congressman wanted to be close to President Trump after he was confirmed by the Senate, so he moved into a small office on the fourth floor of the Old Executive Office Building, next to the White House, taking over space reserved for the Director of National Intelligence, who had yet to assume his position. One White House official called it a power play. (An intelligence official defended Pompeo, saying he was only making use of space where intelligence officers prepare for the President’s Daily Brief, a standard practice.)

Under normal circumstances, Pompeo would have stopped attending the P.D.B. once Dan Coats, Trump’s nominee to serve as D.N.I., was confirmed by the Senate. But the ambitious spymaster managed to stay at Trump’s side throughout his thirteen-month tenure as the C.I.A. director, inflating his role in the process. Under U.S. law, the D.N.I. serves as the President’s principal intelligence adviser and oversees the P.D.B., a summary of the most sensitive intelligence collected by U.S. spy agencies. But at times, Pompeo acted as though he were in charge, repeatedly making the false claim that he personally delivered the P.D.B. to Trump. In reality, one of Coats’s deputies verbally presented the P.D.B. to Trump in the Oval Office. Coats, Pompeo, and as many as ten other top Presidential advisers listened in.

Pompeo’s defenders say he didn’t mean to elbow the D.N.I. out of the way. Rather, officials say, Pompeo hit the ground running before Coats could get in place, and then successfully “managed” the President, in contrast to Secretary of State Rex Tillerson, who Trump fired this week, and other senior national-security officials who were perceived within the White House as disloyal and contemptuous. Being an able politician, Pompeo grabbed the spotlight, increasing his standing in Trump’s mind, they say. Critics inside the Administration accused him of attention-getting and self-aggrandizement.

Many C.I.A. officers had mixed feelings about Pompeo’s choices and aggressive style but, as time went by, told me they came to believe that he used his close relationship with Trump to protect the spy agency from Trump’s wrath. (Before he took office, Trump lashed out at the C.I.A. and other intelligence agencies for concluding that Russia had intervened in the 2016 election to help him win the White House. Since taking office, Trump has generally been supportive of the C.I.A., in contrast to his open hostility to the F.B.I., which is spearheading the Russia investigation.)

By all accounts, Pompeo relished being a spymaster. But he often acted as though the role was too constraining. He wasn’t supposed to weigh in on political or policy matters in White House meetings but did so frequently, often at Trump’s request. At times, Pompeo pitched covert C.I.A. operations to the President without being asked to prepare them, breaking with protocol.

In some national-security Cabinet meetings, Pompeo made pronouncements about alleged Iranian misconduct that other officials said weren’t backed up by intelligence-community assessments, according to officials present. “Pompeo couldn’t help himself,” one official said. “He’s a political animal who acts as if he wants to run for President some day.” One of his early battles in the job was over installing new TVs in the director’s office at C.I.A. headquarters, possibly so he could keep up with Fox News and other channels. C.I.A. security officers initially balked at the request, arguing that the wiring could pose an infiltration threat, but Pompeo insisted, according to one official briefed on the exchange.

What did Pompeo accomplish during his thirteen months at Langley? He quietly reversed Obama Administration edicts limiting the C.I.A.’s role in strikes by American drones, fuelling tensions with the Pentagon. He cast WikiLeaks as a hostile non-state foreign-intelligence service, and pressed the White House for permission to take action against the group and its supporters for publishing C.I.A. hacking tools. While Pompeo has made it a top priority to rebuild the C.I.A.’s capabilities to collect intelligence in Russia, the White House has so far balked at authorizing an aggressive covert campaign to punish Moscow for its interference in the 2016 election. (On Thursday, the White House announced additional sanctions.)

Pompeo’s hard-charging attitude, and his willingness to take risks and delegate authority, made him especially popular with some officers in the C.I.A.’s Directorate of Operations, known as the D.O., which carries out covert operations. Some undercover operatives had long complained of being micromanaged by what they saw as a risk-averse Obama White House. Other intelligence officials told me they sighed with relief when they learned that Pompeo was leaving the post and that Trump was nominating Gina Haspel, who came up in the Directorate of Operations, as the new director.

Some Democratic lawmakers and human-rights groups have criticized Haspel’s role in post-9/11 programs that employed torture against suspected terrorists. Aides said that Democratic senators would aggressively question Haspel during her confirmation hearings about her participation in the programs.

Inside Langley, however, many officers took solace in Trump choosing a career intelligence officer, who will likely play a more traditional role than Pompeo had. “The program was abhorrent and inconsistent with our values, and I understand that senators facing her nomination will ask a number of tough questions and why a human-rights organization would object,” a former intelligence officer who served in the Obama Administration, and who supports Haspel’s nomination, said. “But I think she is highly qualified, and moreover, I think she would stand up and say no if Trump tries to do this again.”

Whatever her baggage, at least she’s “one of us,” another intelligence officer said.