Here’s a theory on why a judge decided to keep Bowe Bergdahl out of prison

FILE - MARCH 25: According to reports March 25, 2015, U.S. Army Sgt. Bowe Bergdahl, who was held prisoner in Afghanistan and exchanged for five Taliban commanders, will be charged with desertion. UNDATED - In this undated image provided by the U.S. Army, Sgt. Bowe Bergdahl poses in front of an American flag. U.S. officials say Bergdahl, the only American soldier held prisoner in Afghanistan, was exchanged for five Taliban commanders being held at Guantanamo Bay, Cuba, according to published reports. Bergdahl is in stable condition at a Berlin hospital, according to the reports. (Photo by U.S. Army via Getty Images)

Army Sgt. Bowe Bergdahl’s brutal five years of captivity by Taliban allies carried significant weight in an Army judge’s decision to spare him prison time for leaving his post in Afghanistan in 2009, legal experts said. Criticism of Bergdahl by President Donald Trump also appeared to push the judge toward leniency.

Videos by Rare

RELATED: Army deserter Bowe Bergdahl says the Taliban was more “honest” with him than U.S. jailers

Army Col. Jeffery Nance didn’t explain how he formulated the sentence that also included a dishonorable discharge, reduction in rank and a fine. But the judge had to consider a complex array of arguments for and against leniency.

Prosecutors asked for a 14-year prison sentence, citing several service members’ serious wounds while searching for Bergdahl. The defense sought to mitigate the punishment with evidence of Bergdahl’s captivity, mental illnesses, contrition and Trump’s harsh criticism.

“It’s really rare for there to be this much mitigation evidence,” said Eric Carpenter, a former Army lawyer who teaches law at Florida International University. “It’s kind of hard to distinguish which is the one that Nance gave the most weight to. But I think the Taliban conditions were pretty onerous.”

What do you think?

Millennials prefer socialism, study says, and they may even want the unthinkable

Another “Teen Mom” star is about to become a mom all over again, and she’s “very excited”