Tuesday is Army Major Jason Wright’s last day as appointed counsel for Guantánamo Bay’s most well-known detainee, Khalid Sheikh Mohammed. It’s also Wright’s last day in the United States Army.

In December of 2011, Wright was detailed to serve as one of two military-appointed lawyers for KSM, the purported mastermind of the 9/11 terror attacks and executioner of journalist Daniel Pearl. Mohammed—along with three co-defendants—faces trial before a military commission at the Guantánamo Bay Naval Base for his role in the attacks, and faces a sentence of death if convicted. Wright spent nearly three years working between 50 and 60 hours a week as a Judge Advocate General (or JAG) on the KSM case. It was the case of a lifetime.

But in a letter dated Feb. 26 of this year, the Army notified Wright that they were taking him off the case. The letter required Wright to attend a nine-month graduate program in military law. Wright requested a deferral (which had been granted when he received the same order the year before), but this time the request was denied. In Wright’s eyes, the order clearly put him in conflict with his ethical obligation to continue representing his client, the third-highest ranking member of al-Qaida. When he followed up, Wright learned that even if he were to attend the graduate program, upon completion he would not be reassigned to U.S. v. Mohammed. His orders were short and unambiguous: either quit the KSM defense team and attend the graduate program, or resign from the Army.

And so on March 26, 2014, after nine years in the Army, Major Wright tendered his resignation. This is his story.

Wright is a believer—or at least he was. He joined the Army post-9/11. He’s seen both sides of the “war on terror” firsthand, having served as an aide to an Army combat general in Iraq, then worked as a criminal defense attorney in Germany for two years before his assignment to the KSM defense team. Ordinarily, JAGs serve as prosecutors before they are detailed as defense counsel, but Wright went directly into defense. “I see more of a chance to challenge yourself as a defense attorney,” he told me.

Wright should be the poster boy for the JAG program at Guantánamo, rather than one of its most outspoken critics. He’s blond, clean-cut, and looks like he could be in a “Go Army” commercial during a Sunday afternoon football game. Over the last two and a half years on the Mohammed defense team, however, Wright’s understanding of how he can best serve his country has evolved. He sees it as a JAG’s duty not merely to secure convictions of alleged terrorists, but to uphold the American system of justice.

“At least within this office,” Wright says of the Mohammed defense team, “there is very much the viewpoint that we’re paid by the government to challenge the government.”

Wright was selected for the team by David Nevin, a civilian attorney appointed as lead defense counsel by the Military Commission Convening Authority in June 2011. Nevin, who has extensive experience trying high-profile death penalty cases in state and federal courts, says he chose Wright from the applicant pool not only because of his professional experience, but because of his unique educational background: Wright was the first JAG to pursue an LLM (the legal equivalent of a master’s degree) in international human rights law from Oxford University. “I remember thinking that he would be an asset to our team because of a number of things,” Nevin says, “including his background in international humanitarian law.”

Nevin is the lead attorney on the case, but he views Wright as a peer and central member of the defense team, not just a junior lawyer he’s been assigned by the Army: “He is an excellent lawyer. A great team manager, organizer, thinker, just an incredible asset.”

The posting was a huge leap from Wright’s previous assignments. He’d only been a practicing JAG attorney for a few years, and while he’d already tried a half-dozen serious felony cases, none were even close to the magnitude of the KSM case. “At the time I thought my role would basically be limited to discovery analysis and drafting motions,” says Wright. “I didn’t think I’d have a prominent role arguing in court or otherwise.” But since his appointment, Wright has taken a central role on the legal team. He has represented Mohammed at every court proceeding since his arraignment in May 2012. Wright estimates he’s spent over 200 days in Guantánamo meetings with his client and attending court proceedings, and another 100 days in Europe and the Middle East attending capital defense training, developing a rapport with potential defense witnesses, and investigating facts crucial to the defense. “I certainly had moments when I’d wake up in the morning and it would take me about five seconds to remember where exactly I was in the world,” Wright says.

Wright’s client, Khalid Sheikh Mohammed, was captured in Pakistan in 2003 and held at various CIA black sites before being sent to Guantánamo in 2006. The first military commissions in Guantánamo were established by the Bush administration to prosecute detainees, but lacked the assurances of a fair trial under the U.S. Constitution and the Geneva Conventions. Defendants were prohibited from hearing much of the evidence against them, and hearsay evidence or admissions gained under torture were admissible. Several military prosecutors resigned in protest. The first commissions were invalidated by the United States Supreme Court in 2006. A revamped Military Commissions Act was enacted in 2009. This new version of the commissions strives for greater transparency and at least the appearance of a fair trial, including provisions affording more autonomy to defense attorneys.

In April 2011, Attorney General Eric Holder announced that Khalid Sheikh Mohammed would be tried under one of these new commissions. Brig. Gen. Mark Martins was appointed to prosecute Mohammed and his co-defendants. Martins fought to distance himself from the perceptions of illegitimacy plaguing earlier versions of the Military Commissions. He readily speaks to the media and invites journalists to attend pretrial proceedings at Guantánamo.

Despite Martins’ efforts, the KSM prosecution has been marred by intrusions into the proceedings by government entities, including the release of a half-million defense attorney emails to prosecutors, the discovery of hidden microphones placed by the FBI in attorney-client conference rooms, and allegations that FBI agents have been spying on defense teams. The Army’s reassignment of Major Wright away from U.S. v. Mohammed—which the defense team has portrayed as yet another symptom of lawlessness in Guantánamo—has only further diminished the appearance of legitimacy that Martins hoped to maintain. U.S. Air Force Lt. Col. David Frakt, who represented Guantánamo detainees Mohammed Jawad and Ali Hamza al-Bahlul under the Bush-era military commissions says that Wright’s removal doesn’t necessarily mean that Nevin and the defense team will be unable to continue to represent KSM. But he sees this whole episode as a missed opportunity to promote the inherent fairness of the commission system. “If ever there were a case to make an exception, I think this is it,” says Frakt. “This was an opportunity to enhance the perception of legitimacy by saying publicly, ‘We’re going to grant this deferment, and in fact we will allow him to stay on as long as necessary because we recognize that the defense function is just as important as the prosecution function.’ They could have turned it into a PR bonanza instead of a PR disaster.”

One of the first things you learn in law school is that if a client doesn’t trust you, he’s won’t allow you to speak on his behalf in court. There is a massive cultural divide between the legal system in which Mohammed was raised, and the legal framework of an American military trial. When Mohammed fired his first group of court-appointed attorneys in 2008, for example, he explicitly rejected the legitimacy of U.S. constitutional law in favor of Islamic Sharia law. Wright points out that even while trying to establish a relationship of trust with his client, reminders that he is a U.S. soldier are inescapable. “It’s very challenging to try to build any relationship when a government has gone to extraordinary lengths to torture someone and to silence them. I wear the same uniform as the guards.”

JAG attorneys operate under the auspices of the U.S. Department of Defense. They are part of the very government that tortured them in CIA dark sites before their transfer to Guantánamo. KSM was subjected to water boarding 183 times in a single month before being brought to the base.

But the Army simply doesn’t believe that Major Wright’s removal will have any lasting effect on the defense team’s ability to continue representing Mohammed. Lt. Col. Alayne P. Conway, an Army public affairs officer, argues that reassigning a JAG—even from a death penalty case—will have a minimal impact on the attorney-client relationship because the civilian attorney, David Nevin (referred to as “Learned Counsel” within the commission setting) will remain on the case.

“In this case, Major Wright’s reassignment did not violate any precept of justice,” Conway says. “The law is clear: the defendants—to include Mr. Mohammed—being tried by the military commissions have the right to qualified and certified military counsel. Therefore, upon Major Wright’s resignation, the defendant, Mr. Mohammed, was immediately assigned a military defense counsel with military defense experience to join his defense team under the supervision of a lead Learned Counsel.”

Other JAG attorneys contend that Wright’s removal constitutes an impermissible breech of the defendant’s rights to effective assistance of counsel and due process under the law. U.S. Air Force Captain Michael Schwartz, who served as a JAG prosecutor before being appointed as defense counsel for Walid bin Attash, one of Khalid Sheikh Mohammed’s co-defendants, worries that the reassignment of a JAG defense attorney creates a substantive legal issue. David Nevin explains that Wright’s removal not only disrupts Mohammed’s relationship with Wright, but also with the attorneys remaining on the defense team. Torture creates mistrust, they argue. Defense attorneys are seen as just another one of these relationships designed to gain a detainee’s trust only to destroy it. “You don’t have to be a psychologist,” says Nevin, “to know that if I’ve come to trust my team to protect me, and suddenly [Major Wright] gets removed—that says that I can’t count on any of you. Any one of you could be gone tomorrow.”

The Army reassignment orders Wright received in February are nothing unusual. As Lt. Col. Conway explained, the graduate program to which Wright was assigned is a requirement for all active Army JAGs. What is unusual, according to the Mohammed defense team, is that the Army has not granted an exception to allow Wright to stay on the team. Based on the magnitude of the case, and the fact that Wright’s deferral to the graduate program was granted without issue the year before, the team expected another routine deferral. When the Army denied the deferral, Wright and Nevin immediately appealed to the Army for an explanation. They were told that under the new detailing orders, Wright had two options: He could either leave the Mohammed defense team and attend the graduate program, or leave the Army.

According to Conway, the denial of Wright’s deferral request had nothing to do with his role as Khalid Sheikh Mohammed’s defense attorney. “The decision to approve a deferral request is made on a case-by-case basis, balancing the need for the deferral and the need of the officer,” said Conway in an email interview. “In Major Wright’s case, The Judge Advocate General [Lieutenant General Flora Darpino] denied the second deferral request because a suitable and competent military defense attorney replacement was available, Major Wright was not the lead or sole counsel, and it ensured Major Wright remained professionally competent and competitive for promotion.”

The defense team won’t say that the Army denied Wright’s deferral for the express purpose of removing him from the team; they simply don’t have enough information to speculate as to the Army’s motives. There is, however, an obvious undercurrent of suspicion among the Mohammed team. The defense team points out that the prosecutor in the case, Mark Martins, has not been similarly reassigned during his three years on the KSM case, though the Army insists that “all military attorneys, including Brig. Gen. Martins, are subject to reassignment.”

Regardless of the Army’s motives, when his deferral from the graduate program was denied Wright faced an ethical dilemma: leave his client for the required graduate course, or quit the Army? Wright reasoned that resigning would allow him to carry out his professional obligation to his client for a few months longer, and to perhaps continue representing Mohammed as a civilian after he leaves the Army. So two weeks ago, Major Wright flew to Guantánamo Bay to represent Mohammed at a series of pre-trial hearings, the last time he did so as a JAG.

In his last week in the Army, Jason Wright is crisscrossing the Washington, DC area, carrying around a two-page checklist that reads like something from a scavenger hunt: a signature from the Housing Office. A mandatory briefing on Military benefits. Another signature from the Career Transition Office. All tasks he must complete before he officially returns to civilian life.

The Mohammed defense team has explored other avenues that would allow Wright to remain permanently on the case. They have requested the Convening Authority—which authorizes funds for the various legal teams—to appoint Wright as a civilian, but to date they have declined to do so. Wright and Nevin have also asked the trial court judge, Colonel James Pohl, to order that a civilian position be created to keep Major Wright on the Mohammed defense team. Pohl has questioned whether he had the authority to do this.

The long-term consequences of Wright’s removal have yet to be seen. The 9/11 military commissions have been unable to shake the perception of illegitimacy, and Wright’s removal seems to heighten this perception. The worst-case scenario would be that Wright’s removal has the effect that Guantánamo defense attorneys like David Nevin and Captain Schwartz fear: The relationship between the defense team and their client is weakened past the point of functionality.

If Khalid Sheikh Mohammed is tried and convicted, the issue of Wright’s reassignment away from the case will almost certainly become an issue on appeal. “I think [Wright’s reassignment] imperils the case for the prosecution,” says Nevin. He contends that the disruption of the attorney-client relationship denies Mohammed his constitutional rights to due process and to the effective assistance of counsel. “At some point an appellate court will step in and say ‘Enough. This is not a valid result, given all of these shenanigans.’ ”

In the meantime Wright returns to civilian life, critical of the legitimacy of the military commissions and cynical about his client’s chances for a fair trial. “It’s more disbelief than disillusion,” he says. “I don’t have any illusions any more that this process has problems. It’s more a disbelief that we have a justice system where we can add up all of these barriers to the attorney-client relationship and the defense function and still call it a court system.”