The US Senate has confirmed Gina Haspel to be director of the CIA, ending a bruising confirmation fight centred on her ties to the agency's past use of water boarding and other brutal interrogation techniques.

Ms Haspel, who will be the first woman to lead the CIA, is a 33-year veteran at the agency currently serving as its acting director.

The tally was 54-45 in favor of her nomination in the100-member chamber, where a simple majority was required for confirmation.

Six Democrats joined US President Donald Trump's fellow Republicans in voting for Ms Haspel, and two Republicans voted no.

Ms Haspel was approved despite stiff opposition over her links to the CIA's use of harsh interrogation methods, including waterboarding, a type of simulated drowning widely considered torture, in the years after the 11 September 2001 attacks.

An undercover officer for most of her CIA career, Ms Haspel in 2002 served as CIA station chief in Thailand, where the agency conducted interrogations at a secret prison using methods including water boarding.

Three years later, she drafted a cable ordering the destruction of videotapes of those interrogations.

Republican Senator John McCain, who has been away from Washington all year as he battles brain cancer, urged the Senate not to vote for Ms Haspel. He did not take part in today’s vote.

Tortured himself while a prisoner of war in Vietnam, Mr McCain said approving Ms Haspel would send the wrong message, and the country should only use methods to keep itself safe "as right and just as the values we aspire to live up to and promote in the world."

Ms Haspel also had strong support from Mr Trump's administration, many current and former intelligence officials and a wide range of lawmakers, including Democrats.

Senator Mark Warner, the top Democrat on the Intelligence Committee, which oversaw the nomination, supported Ms Haspel.

"I believe she is someone who can and will stand up to the president, who will speak truth to power if this president orders her to do something illegal or immoral, like a return to torture," he said in a Senate speech before the vote.

Rights groups quickly condemned the vote. Laura Pitter of Human Rights Watch called it "the predictable and perverse by product of the US failure to grapple with past abuses."

Mr Trump nominated Ms Haspel, then deputy director, in March to succeed Mike Pompeo as CIA director.

Ms Haspel became acting director after Mr Pompeo was confirmed as secretary of state.