Andrew Liepman, who is stepping down Friday as deputy director of the National Counterterrorism Center, has spent much of his tenure monitoring a near-constant stream of threats, including the latest al-Qaeda plot to blow up an airplane with an underwear bomb.

But as his six-year stint winds down, Liepman has increasingly sought to look past the latest threat data at longer-term questions, including what and how long it will take for the conflict with al-Qaeda to end.

Al-Qaeda’s core organization in Pakistan was staggered last year by the death of Osama bin Laden and the toll of CIA drone strikes. But in an interview, Liepman said that predictions of al-Qaeda’s demise seem increasingly premature.

“The mission hasn’t been accomplished, al-Qaeda hasn’t been strategically defeated,” Liepman said. “We’ll be done when the bin Laden global jihadist ideology no longer resonates at all.

“I think we’re a ways away from that,” he said.

Liepman, 55, is being replaced by Nicholas Rasmussen, a senior counterterrorism adviser to President Obama who has played a leading role in shaping policies, including the escalating drone campaign against al-Qaeda’s affiliate in Yemen. The transition between the two at NCTC began this week.

Liepman’s departure marks the culmination of a three-decade career, one that followed an unlikely path from studying forestry as an undergraduate at the University of California at Berkeley to a series of high-level positions at the CIA.

Before arriving at NCTC, Liepman served as deputy director of the CIA’s counterterrorism center, which runs the agency’s drone campaign. He also led the CIA’s Office of Iraq Analysis, a position he assumed shortly after President George W. Bush appeared under a “Mission Accomplished” banner on an aircraft carrier. Under Liepman, the CIA delivered a series of increasingly pessimistic assessments of the progress of the war.

Liepman is a California native with a baritone voice and a bald head. His parents’ Jewish families fled Europe in 1938 for Shanghai and relocated to San Francisco a decade after that.

A food aficionado, Liepman traces his fondness for cooking to his mother’s Viennese recipes and his father’s career as a U.S. Army pastry chef and manager of the officer’s club in Carmel, Calif.

Liepman was hired by the CIA in 1982 as an imagery analyst, based largely on a single college course he had taken in photogrammetry, which taught the use of aerial images to map and measure forests along California’s coast.

He said he likely would never have considered working for the CIA if he hadn’t moved to Washington with his wife after she took a job with the Defense Intelligence Agency.

Liepman joined NCTC in 2006, two years after the center was created to solve the intelligence-sharing problems that had plagued U.S. spy agencies leading up to the Sept. 11 plot.

At the time, NCTC was regarded warily by other agencies. It struggled to recruit analysts; they worried that accepting a position there might derail their careers.

Current and former NCTC officials said Liepman — who attracted a loyal following in each of his CIA assignments — helped overcome those obstacles. The number of analysts has tripled, to more than 300.

The hiring surge was due to “his ability to recruit and mentor people,” said Michael Leiter, who served as director of NCTC until last year.

“Senior executive officers from the CIA actively sought Andy to work for,” he said. “He protected them, helped them get good jobs when they went back to their core agencies.”

Leiter’s successor, Matthew Olsen, said Liepman tutored him on aspects of his job, including how to brief the president. “He helped me find my way,” Olsen said.

Liepman’s tenure hasn’t been entirely smooth. NCTC faced harsh criticism after failing to detect an al-Qaeda plot to blow up a Detroit-bound airliner on Christmas Day, 2009.

Liepman said his “biggest trepidation” is the blame and potentially damaging consequences that NCTC and other organizations could face if a terrorist plot were to succeed. “We’re a better organization and we’re bigger,” Liepman said. “But there’s still a dangerous enemy out there. At some point, some smart terrorist is going to get through.”