FORT BRAGG, N.C. — James Hatch, a broad-shouldered former Navy SEAL, limped to the witness stand Wednesday to discuss a military service dog killed during the search for Army Sgt. Bowe Bergdahl. When Hatch said the dog’s name, Remco, he wept.

His testimony was heard to determine if events stemming from Bergdahl’s abandonment of his post and subsequent Taliban capture should factor into how much punishment he receives. Bergdahl, 31, pleaded guilty to charges of desertion and misbehavior before the enemy after he walked off his remote outpost in eastern Afghanistan on June 30, 2009.

Hatch testified he and other SEALs had known before the July 8 mission that Bergdahl voluntarily left, which at the time was disputed. Early reports said he was captured on a patrol. “He’s got a mom,” Hatch said, when prosecutors asked why his team went on the mission despite what they knew. “He’s an American.”

Hatch said a militant shot Remco in the head from inches away, while another shot Hatch in the right leg, shattering his femur. It was a career-ending injury that resulted in 18 surgeries in two years. Hatch now trains working dogs, and brought his own service dog, Mina, who lay at his feet during his testimony.

The Army has maintained Bergdahl’s disappearance triggered a wave of risky, hastily planned missions, like the one Hatch was on, and diverted resources like drones and helicopters from across Afghanistan, forcing those troops to fight with fewer resources.

Long, brutal search missions on foot with at times limited resupply of food and water exhausted troops and eroded morale, a former soldier in Bergdahl’s unit told The Washington Post. Thousands of troops were involved in the search, which lasted as long as 45 days for some.

Bergdahl’s lawyers have said he cannot be blamed for the long trail of consequences, where both commanders and militants made decisions that directly led to the fate of troops wounded and killed.

Army Col. Jeffrey R. Nance, the judge who will determine Bergdahl’s potential sentencing, has yet to rule on the defense’s motion to dismiss the case following President Trump’s recent comments, in which he alluded to past statements calling Bergdahl a “dirty, rotten traitor.”

On Monday, the defense argued Trump’s rhetoric has hurt Bergdahl’s ability to get a fair sentencing as he faces as much as life in prison following a guilty plea of misbehavior before the enemy. Another charge for desertion carries as many as five years.

Nance also heard testimony from several members of Bergdahl’s chain of command supervisors. Capt. John P. Billings, his platoon leader at the time, said there was a dramatic increase in operations following Bergdahl’s abandonment, and many soldiers were exhausted and sick.

Billings said he came down with dysentery and couldn’t change his soiled uniform for 19 days.

“Imagine putting yourself on the side of a mountain with little water, little sleep, little chow, having not showered in 10 days, and not knowing when you’re going to get to talk to your family next,” Billings said, describing the conditions during search operations. “That’s about what it was like.”

Evan Buetow, a sergeant in charge of Bergdahl then, said he could barely sleep and was also stricken with illness. He was assigned to protect the base from a stiflingly hot bunker for 10 days, he said.

The legal teams sparred over some evidence. The defense said an Army enlistment waiver issued to Bergdahl for mental health issues could have changed how Bergdahl’s leadership managed him.

The failure of the Army to disclose his release by the Coast Guard on mental health grounds was “the first domino that knocked down all the others,” a member of the defense counsel said, though the team stopped short of entering their evidence.

Defense and prosecution attorneys also debated the merits of including Remco’s harness as evidence.

The prosecution said they presented the torn harness, with an infrared U.S. flag still attached, as evidence of destruction of government property stemming from Berghdal’s disappearance, along with losing Remco himself. The defense team argued it did not add value as an exhibit.

Hatch held the black tangle of straps in his hands. A beige exhibit tag dangled from it. As the legal teams debated its value, Hatch kissed it softly, then handed it to Nance, who determined it was fit to be included as evidence of a mission gone bad.