A US psychologist who helped develop the CIA's "enhanced interrogation" techniques has given evidence before a military tribunal in Guantánamo Bay.
James Mitchell said he had only agreed to testify there because families of the 9/11 victims were present.
Dr Mitchell and fellow psychologist Bruce Jessen developed the controversial interrogation methods, which included waterboarding.
Five men held at Guantánamo are due to go on trial over the 9/11 attacks.
The five include Khalid Sheikh Mohammed, the alleged architect of the operation that targeted Washington and New York in 2001.
Mr Mohammad has alleged he was repeatedly tortured during his detention in Guantánamo Bay, Cuba. CIA documents confirm he was subjected to waterboarding - simulated drowning - 183 times.
The four others - Walid bin Attash, Ramzi bin al-Shibh, Ammar al-Baluchi and Mustafa al-Hawsawi - were also interrogated by the CIA in a network of overseas prisons, known as "black sites", before they were passed on to the US military.
At a pre-trial hearing in Guantánamo, lawyers for the accused are seeking to have evidence statements that their clients made to the FBI thrown out because of the CIA interrogation methods used to extract them.
A group of relatives of 9/11 victims are observing the hearing in the court's spectator's gallery, although hidden from view by a curtain, the New York Times reported.
Dr Mitchell, appearing as a witness, told one of the defence lawyers that he had agreed to testify "for the victims and families. Not you".
"You folks have been saying untrue and malicious things about me and Dr Jessen for years," he added, according to the New York Times.
The defendants looked on without showing emotion, reporters said.
The hearing is expected to last two weeks. The full trial has been scheduled to start on 11 January 2021.
All five defendants are charged with war crimes including terrorism and the murder of almost 3,000 people. If found guilty, they face the death penalty.
What is waterboarding?
It is an interrogation process that causes the subject to experience the sensation of drowning.
The subject is strapped to an angled board facing down and a cloth is placed over their mouth. Water is poured over the face, creating the feeling that the lungs are filling with water.
The CIA began using waterboarding, among other interrogation processes, after the 9/11 attacks.
A Senate committee concluded the technique did not provide critical intelligence, but some ex-CIA officials insisted it had provided actionable information.
The technique is illegal. President Barack Obama banned torture as an interrogation technique in 2009.
US President Donald Trump, however, has said he believes waterboarding works, stating "we have to fight fire with fire".