FORT BRAGG, N.C. — A former Navy SEAL who helped lead a search for Army Sgt. Bowe Bergdahl after the soldier deserted his Afghanistan post said Wednesday he knew that Americans would be killed or hurt in trying to find him.

“Everyone on that mission was aware that he walked off" his post, James Hatch said at a sentencing hearing for Bergdahl, who was captured and held by the Taliban for five years. Asked why he and his team went looking for him, Hatch replied: “He’s an American.”

"It's really something I never questioned," he said.

Hatch, a former senior chief petty officer, was shot in the leg during the mission that was launched about a week after Bergdahl abandoned his outpost in Afghanistan in 2009.

As soon as Hatch was told by an intelligence officer about the mission, he said he knew Americans would be killed or hurt in trying to rescue him.

Bergdahl, 31, pleaded guilty last week to charges of desertion and misbehavior before the enemy. He faces a potential life sentence on the misbehavior charge.

Prosecutors are attempting to show that Bergdahl’s decision to walk away put soldiers at risk. His disappearance triggered a massive manhunt and diverted resources from other parts of the war.

“Everyone in Afghanistan was looking for Bergdahl,” said Capt. John Billings, who was Bergdahl’s platoon leader when he walked off the post.

Billings said his platoon spent weeks searching for Bergdahl in austere conditions with little food or water and his soldiers would go without showers for up to two weeks at a time.

Hatch offered a harrowing account of an attempted rescue mission. He led a team of special operations forces based in Jalalabad, Afghanistan. Their mission was to capture or kill “high value targets” or rescue hostages.

When told they were to rescue a missing American, that became the team's top priority.

The team came under immediate fire as they were descending toward a place where they were told Bergdahl might be held. It was not clear whether he was there, but the area was filled with militants and civilians.

Helicopters carrying the SEALs came under fire as they began descending toward the spot. Hatch said he saw tracer fire streaming toward the helicopters.

Civilians, including children, were also running around the area. Hatch described carrying two young children to safety.

He became emotional when he talked about a service dog, Remko, who was shot in the head and killed by a militant.

Hatch was shot in the leg above the knee. “I was laying there trying not to scream, but screaming,” Hatch said.

Hatch, who had a noticeable limp as he approached the witness stand, said he underwent 18 procedures over several years. He was accompanied by a service dog.

Billings, the platoon leader, said he initially thought he was the victim of a bad joke when his soldiers first told him Bergdahl was missing. His platoon sergeant told him it was no joke, and he sent a message notifying his higher headquarters of a missing soldier.

The next 10 days were a "big blur," Billings said.

Bergdahl's team leader at the time, Evan Buetow, described the sense of urgency to find him. "My guy was gone," Buetow said, putting his head in his hands and reaching for a box of tissues.

Bergdahl’s case has generated a storm of controversy since the Obama administration reached a deal in 2014 for the soldier's release in exchange for five Taliban militants held at Guantanamo Bay, Cuba. The five militants were turned over to Qatar.

President Barack Obama held a Rose Garden ceremony with Bergdahl's parents to announce their son's release from captivity.

As a candidate President Trump called Bergdahl a “dirty rotten traitor.” The White House more recently issued a statement highlighting the importance of an independent military justice system.

Army Col. Jeffery Nance, the military judge, said he has not yet ruled on a defense motion to dismiss the case on the grounds that Trump’s comments prevent Bergdahl from getting a fair sentence.

MORE: Military judge mulling whether Trump comments tainted Bergdahl hearing