SAN ANTONIO -- The officer who led the investigation of Bowe Bergdahl's disappearance and capture in Afghanistan six years ago says he doesn't think the Army sergeant should go to prison.

Maj. Gen. Kenneth Dahl testified Friday at Fort Sam Houston in San Antonio that Bergdahl said he walked away from his post as part of a plan to spark a search and get the attention of a general so he could express his concerns about his unit's leadership. Dahl told a packed courtroom that Bergdahl felt the problems were so severe that they put his platoon in danger, but that Bergdahl's perceptions were "completely off the mark."

Dahl said Bergdahl had an elaborate plan to head from his post to the forward operating base roughly 19 miles away, expecting to arrive while a search was underway and to create a "PR event" that might get a general to listen to him.

"He felt it was his duty to intervene," said Dahl, who described Bergdahl as having few friends but who seemed motivated to help others.

He concluded his statements by saying he doesn't think Bergdahl should serve time in jail.

Bergdahl was captured by the Taliban after leaving his post on June 30, 2009, and held until last year, when he was exchanged for five Taliban commanders being held at the U.S. detention center at Guantanamo Bay, Cuba. His commanding officers in Afghanistan testified Thursday about the grueling 45-day search for Bergdahl, saying it put other soldiers in danger.

Military prosecutors charged Bergdahl in March with desertion and misbehavior before the enemy. His Article 32 hearing, which was concluded Friday, will help determine whether he should face a court-martial.

The prisoner exchange drew a lot of public criticism, with many Republicans and some Democrats saying they felt it was politically motivated and contrary to the U.S. policy of not negotiating with terrorists.

Terrence Russell, with a military agency that works with soldiers and others who have been held captive and who debriefed Bergdahl, testified that Bergdahl was subjected to worse conditions than any American prisoner of war since the Vietnam War and was "skin over bones" near the end of his captivity.

Russell said Bergdahl's captors treated him like a "dirty animal," beating him with rubber and copper hoses and giving him little food and water. He said Bergdahl was kept in a cage for three years and had uncontrollable diarrhea for years.

Bergdahl tried to resist and attempted to escape on multiple occasions, including one attempt in which he managed to elude recapture for 8½ days, Russell said. He acknowledged the public criticism leveled at Bergdahl, but said Bergdahl did the best he could under the circumstances.

"They don't know what the facts are. Nobody knows Sgt. Bergdahl's story. I hope someday the world gets to understand how difficult Sgt. Bergdahl had it," he said.

Curtis Aberle, a family nurse practitioner at Fort Sam Houston who has been treating Bergdahl, said Bergdahl suffered extensive injuries during his time as a prisoner that have made him unfit to remain in the military.

He said Bergdahl has muscular nerve damage in his lower legs, a degenerative disc in his lower back and an injury that has left him with limited movement in his shoulder — injuries that he said were caused by Bergdahl being kept in a crouched position for extended periods.

Aberle said Bergdahl also suffers from post-traumatic stress syndrome, but he didn't mention any other psychiatric issues Bergdahl may have.

While cross-examining witnesses called by the prosecution on Thursday, one of Bergdahl's lawyers mentioned that Bergdahl had received a psychological discharge from the U.S. Coast Guard and that an Army psychiatric board had concluded that Bergdahl possessed a "severe mental defect." Military officials and prosecutors downplayed or disputed those mental health claims.

Bergdahl did not testify in his own defense. His lead attorney, Eugene Fidell, said any relevant information about his capture is included in an extensive interview Bergdahl gave military investigators last year. He repeated his call for that report to be released, saying it would help tell Bergdahl's side of the story and counteract some of the negative publicity he has faced since the prisoner exchange.

While wrapping up their cases, military prosecutor Margaret Kurz said Bergdahl should face a court-martial because his decision led to a lengthy search that put other soldiers in danger.

Fidell said Bergdahl never intended to avoid his duty and that his case should be treated like a one-day AWOL stint, which he said carries a penalty of 30 days' confinement.

If Bergdahl is tried and convicted of the misbehavior before the enemy charge, he could get life in prison. He also could be dishonorably discharged, reduced in rank and made to forfeit all pay if he's convicted.

The officer who presided over the hearing will forward his recommendations to Gen. Robert Abrams, the commanding general of U.S. Army Forces Command. Abrams will decide whether the case should be referred to a court-martial or be resolved in another manner.