Navy Seal military working dog Remco who died in a rescue mission for Bowe Bergdahl (Pictured 2008)

A former Navy SEAL cried Wednesday as he testified about a military dog killed on a mission with him to find Army Sgt. Bowe Bergdahl, who walked away from his post in Afghanistan and was held by the Taliban for five years.

The Navy SEAL, who suffered a career-ending injury during that mission, testified at Bergdahl's sentencing hearing.

Bergdahl pleaded guilty last week to desertion and endangering his comrades. He faces up to life in prison.

As the hearing got underway, an Army judge said he was still considering a motion by the defense to dismiss the case.

The defense has argued that President Trump's comments about Bergdahl prevent him from having a fair sentencing hearing.

The wounded SEAL, retired Navy Senior Chief Petty Officer James Hatch, entered the courtroom with a limp and a service dog named Mina. He was largely stoic and spoke in measured tones except for several times when he talked about the slain military dog.

Hatch said the dog helped protect his team by locating enemy fighters after the SEALs lost sight of them in a chaotic situation.

U.S. Army Sergeant Bowe Bergdahl arrives at the courthouse Wednesday for the second day of sentencing proceedings in his court martial at Fort Bragg

Fomer Navy Seal Petty Officer James Hatch, left, to give testimony against U.S. Army Sgt. Robert Bowdrie "Bowe" Bergdahl, on Wednesday

'His name was Remco,' Hatch said as his voice cracked.

'Take your time,' said the prosecutor, Army Maj. Justin Oshana.

Hatch said his team's helicopters came under fire as they landed in an area near the Pakistan border where they had information on Bergdahl's possible whereabouts. He said the mission was hastily planned, and their only objective was the Bergdahl search.

Remco was leading them through a field when the dog located two enemy fighters that the team had seen at a distance. Hatch said the fighters sprayed AK-47 bullets at them, killing the dog. He was hit in the leg.

'I screamed a lot. It hurt really bad ... I thought I was dead,' he said.

Hatch said he believes he would have died if a comrade hadn't quickly applied a tourniquet. Hatch has subsequently had 18 surgeries.

Former Navy SEAL James Hatch (Pictured) in Norfolk, Va was wounded from enemy fire while searching for Army Sgt. Bowe Bergdahl (June 2015)

He now runs a nonprofit dedicated to the care and support of military and law enforcement dogs.

Prosecutors are expected to call more witnesses in the afternoon to discuss the search missions and resulting wounds to multiple soldiers.

The judge, Army Col. Jeffery Nance, ruled those injuries would not have happened had Bergdahl, 31, not endangered his comrades in 2009 by walking away from his post.

Nance said Monday that he would be fair and hasn't been influenced by Mr. Trump, but that he does have concerns that the president's comments are affecting public perceptions.

While campaigning for president, Mr. Trump repeatedly called Bergdahl a traitor and suggested that he be shot or thrown from a plane without a parachute.

Nance ruled in February that those comments didn't constitute unlawful command influence, noting that Mr. Trump was a civilian candidate for president at the time.

The defense argued that Mr. Trump revived his campaign comments the day of Bergdahl's plea hearing, by saying at a news conference that he thinks people are aware of what he said before.

Prosecutors made no deal to cap Bergdahl's punishment, so the judge has wide leeway to decide his sentence. Several more days of testimony are expected.

Bergdahl, from Hailey, Idaho, has said he was caged, kept in darkness and beaten, and tried to escape more than a dozen times before President Barack Obama brought Bergdahl home in 2014 in a swap for five Taliban prisoners at Guantanamo Bay.