FORT MEADE, MD. -- An architect of the brutal CIA interrogation and detention program developed after the Sept. 11 attacks defended the agency and its practices on Tuesday as those techniques become the focus of an effort to dismiss key evidence against five men charged in the terrorist plot.

James Mitchell spent the first day of what is expected to be at least a week of questioning by defence teams at the U.S. base at Guantanamo Bay, Cuba, providing details about the CIA's interrogation program as well as what he said was the “context†necessary to understand it.

The CIA was the “tip of the spear†in the months after the Sept. 11, 2001, terrorist attacks and was urgently trying to gather vital intelligence using techniques that had been authorized by the U.S. government, the retired Air Force psychologist told the court.

“We were trying to save American lives,†Mitchell said.

Mitchell is facing questions now because lawyers for the five men accused of planning and providing logistical support for the Sept. 11 attacks are seeking to prevent the government from using statements the defendants gave to the FBI as evidence against them in a war crimes trial scheduled to start next January at the U.S. base in Cuba.

The testimony in Guantanamo is an important milestone in the Sept. 11 war crimes proceedings, which have been bogged down in the pretrial phase since the May 2012 arraignment.

The five defendants, who include the self-proclaimed mastermind of the Sept. 11 hijacking plot, were subjected to waterboarding and other methods now widely regarded as torture. Mitchell, who helped develop the program with another private contractor and others, insisted the CIA feared “another catastrophic attack,†possibly involving nuclear weapons, and was trying to stop it.

“My sole focus was stopping the next attack,†he said.

Mitchell agreed to come to Guantanamo to testify without a subpoena to give his version of events, which he also detailed in a book, called “Enhanced Interrogation,†that he co-wrote with a CIA spokesman.

“I'm happy to talk about my role in the program and what the program did,†he told the court.

At times, however, he appeared to bristle at the questioning. When defence lawyer James Connell thanked him for coming to court, he replied, “I did it for the victims and families not for you.â€

Mitchell and another psychologist, Bruce Jessen, were contracted by the CIA to develop the interrogation program, which also included intense sleep deprivation, confinement in a small box, prolonged shackling in “stress positions,†and being doused with cold water.

Defence lawyers for the five men charged in the attacks have called the contractors, who observed and took part in interrogations at clandestine CIA facilities, as witnesses in an effort to disqualify statements the defendants made to the FBI after they were transferred to Guantanamo in September 2006.

It was the first time that the defendants and one of the main architects of their brutal treatment had faced each other in court.

Mitchell and Jessen gave depositions in a lawsuit filed by the American Civil Liberties Union on behalf of three former prisoners, including one who died in custody. The case was settled for undisclosed terms in August 2017 and the two former contractors did not testify in court.

“This testimony marks a critical moment for reckoning with the torture committed in the American people's name,†said ACLU staff attorney Dror Ladin, “Mitchell and Jessen, along with collaborators in the U.S. government, are responsible for shameful cruelty that the CIA is still trying to cover up.â€

Mitchell was expected to be followed on the stand by Jessen. Their testimony will likely take up much of a pretrial hearing scheduled to last two weeks.

The defendants include Khalid Shaikh Mohammad, an al-Qaida operative who has portrayed himself as the mastermind of the Sept. 11, 2001, attacks. All five face the death penalty if convicted of charges that include terrorism and nearly 3,000 counts of murder for their alleged roles planning and providing logistical support to the hijacking plot.

Under a 2006 law that set up the military commission, any statements must be voluntary to be admitted into evidence and the government is not seeking to use at the trial anything the men said while in CIA custody.

But the prisoners also gave what prosecutors have called “clean†statements to the FBI after they arrived at Guantanamo.

Lawyers for the five defendants argue that everything the men have said in custody was tainted by the torture they were subjected to while in CIA confinement.

James Connell, a lawyer for defendant Ammar al-Baluchi, said he believes the FBI helped guide some of the questioning of the men and that others in the government were also involved in developing the program starting with the capture of a prisoner known as Abu Zubaydah in 2002.

“Dr. Mitchell plays an important role but ultimately a small one,†in developing and carrying out the interrogations, said Connell, whose client is a nephew of Mohammad.

A Senate investigation in 2014 found that the interrogation program designed by Mitchell and Jessen was used on 39 detainees and produced no useful intelligence. They were paid $81 million for their work, according to the Senate report.

Mitchell and Jessen previously worked at the Air Force survival school at Fairchild Air Force Base outside Spokane, Washington, where they trained pilots to avoid capture and resist interrogation and torture. The CIA hired them to reverse-engineer that training to break terrorism suspects.

They defended their work when the lawsuit was settled, arguing that neither contractor condoned or conducted any mistreatment of prisoners and that the overall program was authorized by the government.

Jessen said in a statement then that he and Mitchell “served our country at a time when freedom and safety hung in the balance.â€

The proceedings at Guantanamo were being transmitted to several government installations in the U.S., including Fort Meade, Maryland, where they were viewed by The Associated Press.