FORT BRAGG, N.C. -- A former Navy SEAL testified Wednesday that his military career ended when he was shot in the leg during a hastily planned mission to find Army Sgt. Bowe Bergdahl after the soldier left his post in Afghanistan.

Retired Senior Chief Petty Officer James Hatch told the judge that his team had about 90 minutes to plan their mission and board helicopters after receiving information about Bergdahl's purported whereabouts shortly after he disappeared in 2009. While pursuing enemy fighters on foot, Hatch was hit by fire from an AK-47. Hatch says he survived because members of his team quickly applied a tourniquet while waiting for a medical helicopter.

"They saved me from bleeding to death for sure," he testified during the pretrial hearing. Hatch, who entered the courtroom with a service dog and a limp, said he's had 18 surgeries because of the wound.

Also on Wednesday, the military judge told defense attorneys they can ask potential military jurors about President Trump on a lengthy written questionnaire. Defense lawyers have argued Mr. Trump's criticism of Bergdahl will prevent him from getting a fair trial on charges of desertion and misbehavior before the enemy.

Get Breaking News Delivered to Your Inbox

Prosecutors want to use the injuries to Hatch and others as evidence during sentencing if Bergdahl is convicted. The judge, Col. Jeffery Nance, already ruled that the injury evidence can't be used during the guilt-or-innocence phase of the trial scheduled for October.

A legal scholar not involved in the case, Eric Carpenter, said the decision on the injuries could be pivotal.

"This evidence has already been excluded from the guilt phase of the trial, and if it is excluded during the sentencing phase, the heart of the government's case will be gone," said Carpenter, a former Army lawyer who teaches law at Florida International University. "This might make the government more receptive to a deal."

Defense attorney Eugene Fidell declined to say after the hearing whether his client is interested in a plea bargain.

The topic also came up during the hearing. Defense attorneys asked the judge to rule that any alleged desertion ended when Bergdahl was captured by the Taliban hours after he left the remote post. They say the determination is needed so they can advise their client on how to plead to the desertion charge.

"We need to know so we can tell Sgt. Bergdahl what the consequences are," Fidell told the judge, Col. Jeffery R. Nance.

Nance responded that Bergdahl can choose to plead guilty to the lesser offense of unauthorized absence, or AWOL, but that prosecutors could continue pursuing the more serious desertion charge if they weren't satisfied. The judge said he would rule later on the defense's arguments about the duration of Bergdahl's absence.

The judge also said he would rule later on a motion to dismiss the misbehavior-before-the-enemy charge, which could land Bergdahl in prison for life. Defense attorneys say prosecutors chose the wrong building blocks for the offense because the actions cited in the charge wouldn't be independently criminal, an argument that prosecutors dispute.

Later in the hearing, Nance said he would allow the defense to probe potential jurors' feelings about Mr. Trump in a questionnaire being sent in the coming weeks. Prosecutors have objected to 17 of the approximately 40 questions, including ones asking how prospective panel members voted in the presidential election.

"I'm going to let you ask pretty much all the questions, but with some changes to address the government's concerns," Nance said.

Nance asked for further written arguments before the questionnaire is finalized. The judge previously said he would allow the defense wide leeway to question potential jurors, even though he rejected a motion to dismiss the case over Mr. Trump's comments entirely in a February ruling.

Bergdahl left his remote post in Afghanistan in 2009 and was subsequently held by the Taliban and its allies for about five years. The military probe of Bergdahl began soon after he was freed from captivity on May 31, 2014 in exchange for five Taliban prisoners. Former President Obama was criticized by Republicans who claimed he jeopardized the nation's security with the trade.

Bergdahl, who has been assigned to desk duty at a Texas Army base, has said he walked off his post to cause alarm and draw attention to what he saw as problems with his unit.