Now that Bowe Bergdahl has pleaded guilty to desertion in combat, taxpayers may owe him several hundred thousand dollars.

Last month a military judge sentenced Bergdahl to be busted from sergeant to private and dishonorably discharged.

But since Bergdahl was not sentenced to any prison time on charges of leaving his post in Afghanistan and misbehavior before the enemy he should have ample time to spend the money.

If he gets it.

It might strike some taxpayers as somewhat goofy that Bergdahl could be entitled to a large sum of money for willingly walking off his Army guard post in Paktika province in mid-2009 and then spending several years in Taliban captivity.

In a highly controversial 2014 move, Barack Obama, who wanted the Guantanamo Bay Detention Facility emptied anyway, swapped five senior Taliban leaders imprisoned there for Bergdahl’s release. Technically, the exchange wasn’t a swap, you understand, just a compelling coincidence.

Obama held a premature Rose Garden photo-op with Bergdahl’s parents hailing the soldier’s release and the heroic service. Except — Oops! — the soldier’s real story, revealed by angry fellow service members and investigated by the military, turned out to be not so heroic.

From the moment of his “capture” June 30, 2009, Bergdahl became eligible for extra captive pay, in addition to his sergeant’s salary and various allowances for such things as deployment, housing, subsistence and prisoner per diem.

The Army Times did some calculations and came up with a possible payment in excess of $300,000.

The exact amount payable would depend on his changing service status between various calendar dates. At first he was classified “Whereabouts Unknown” and then “Missing-Captured.” Since his return, Bergdahl has been assigned to desk duty with appropriate pay. But perhaps pleading guilty to desertion would change the captured status and pay.

The actual calculations have been delayed during the legal proceedings and could be extended further if Bergdahl appeals the discharge sentence, as his lawyer has indicated.

The next step, however, is to await pending approval of the sentence by Gen. Robert Abrams, commander of Army Forces Command.