FORT BRAGG, N.C. — The sentencing hearing for Sgt. Bowe Bergdahl, who walked away from his post in Afghanistan in 2009, began on Wednesday with an ex-Navy SEAL’s assertion that he knew the military operation to find the missing soldier would be dangerous.

“Somebody’s going to get killed or hurt trying to get that kid,” Jimmy Hatch recalled telling another member of his task force before setting off on a mission to find Sergeant Bergdahl. Mr. Hatch was shot in the leg during the rescue effort and later underwent surgery 18 times.

The defense declined to cross-examine Mr. Hatch.

In other developments, the judge, Col. Jeffery R. Nance, said he was not yet ready to rule on the defense’s argument that recent comments by President Trump had made a fair hearing impossible. The defense has argued that the president seemed to endorse previous assertions, made when he was a candidate, that Sergeant Bergdahl was a traitor and deserved execution. As commander in chief, he is the superior officer of all the military officials responsible for disciplining Sergeant Bergdahl.

Sergeant Bergdahl, who was captured by the Taliban and held captive for five years, has pleaded guilty and faces up to life in prison. Colonel Nance will determine his sentence after a hearing that is expected to last into next week.