The Senate voted 54-45 Thursday to confirm Gina Haspel to lead the Central Intelligence Agency — once sworn in, she would become the first woman to hold the post.

Haspel succeeds Mike Pompeo, who was confirmed as Trump’s secretary of state last month.

Six Democrats helped Republicans in confirming Haspel: Sen. Joe Manchin of West Virginia, Sen. Joe Donnelly of Indiana, Sen. Bill Nelson of Florida, Sen. Heidi Heitkamp of North Dakota, Sen. Jeanne Shaheen of New Hampshire, and Sen. Mark Warner of Virginia – most of whom are up for re-election this November in states Trump won handily in 2016.

Haspel told Congress, in a letter sent to Warner on Monday, that she now feels the spy agency should not have employed the harsh interrogations program used on al Qaeda detainees that included waterboarding.

In the letter, Haspel also acknowledged that it was “a mistake” for the CIA not to have briefed Congress about the program at its inception.

“With the benefit of hindsight and my experience as a senior agency leader, the enhanced interrogation program is not one the CIA should have undertaken,” she wrote in the letter to Warner.

“While I won’t condemn those that made these hard calls, and I have noted the valuable intelligence collected, the program ultimately did damage to our officers and our standing in the world,” Haspel continued.

She had not expressed those feelings publicly, during her contentious confirmation hearing last week. Haspel told the committee that she would not resurrect the agency’s controversial rendition, detainee, and interrogation program if she became CIA director, but went no further.

“I don’t believe that torture works,” she told the committee, but stopped short of saying whether the interrogation program was “immoral” or should have been carried out.

Many Democrats have expressed concern about Haspel’s nomination.

“Gina Haspel and the CIA have committed one of the most blatant abuses of power in recent history, aided and abetted by a total failure of Congressional oversight,” Sen. Ron Wyden, D-Oreg., said in a statement Wednesday. “I have very grave concerns about Ms. Haspel and believe her background makes her unsuitable to be CIA director.”

Haspel is well-regarded within the agency. She joined the CIA in 1985 and has held a series of high-ranking positions at the intelligence agency throughout her lengthy career, including senior leadership positions within the agency’s National Clandestine Service, which oversees the agency’s spy operations overseas and its most covert operations programs.

At the request of Congress, the CIA has declassified documents shedding light on Haspel’s career in covert operations, particularly in her reported role at the agency’s “black site” in Thailand.

The committee’s report on the CIA’s rendition program said senior al Qaeda operatives Abu Zubaydah and Abd al-Rahim al-Nashiri were detained at that location.

The report said that while at the black site in Thailand in 2002, Zubaydah was subjected to the controversial practice of waterboarding 83 times and to other “stress” techniques such as being slammed against walls, deprived of sleep and placed in a coffin-sized box for up to 226 hours.

Sen. John McCain of Arizona was not in Washington for the vote but announced last week that he opposed her nomination.

In March, McCain noted that Haspel’s CIA career “has intersected with the program of so-called ‘enhanced interrogation techniques’ on a number of occasions.”

“The torture of detainees in U.S. custody during the last decade was one of the darkest chapters in American history,” McCain said in a statement. “Ms. Haspel needs to explain the nature and extent of her involvement in the CIA’s interrogation program during the confirmation process.”