A CIA officer who was the first woman to lead the agency's clandestine service, but was also closely tied to the agency's interrogation program, will not get to keep that job as part of a management shakeup announced Tuesday by CIA Director John Brennan, U.S. officials said.

The woman had served as director of the National Clandestine Service on an interim basis over the past two months and was seen by many in the agency as a front-runner to keep the post.

But the woman, who remains undercover, faced opposition from senior lawmakers over her ties to an interrogation program that critics have said employed torture to get information from al-Qaida captives after the Sept. 11, 2001, attacks.

Instead, Brennan has given the job to a 57-year-old veteran male officer who served multiple overseas tours in Pakistan, Latin America and Africa, according to public records. He is also undercover, U.S. officials said.

The move marks the resolution of a decision that had become a dilemma for Brennan, who faced a bruising confirmation fight over his own ties to the interrogation program.

The female officer had broad support within the agency and had previously served as deputy director of the clandestine service. But her background posed significant political problems for Brennan. She had run one of the so-called black site secret prisons that the CIA set up after the Sept. 11 attacks.