Sgt. Bowe Bergdahl, who deserted his Army outpost and was taken prisoner by the Taliban, has asked President Obama to pardon him before leaving the White House next month, according to a report Friday evening.

Bergdahl was freed following five years in captivity in 2014 when the U.S. gave up five Taliban detainees in return for the disgraced service member. The letter was addressed to Obama and thanked him for making the swap that brought him back to the U.S. He is now petitioning the Justice Department for clemency before President-elect Trump takes office due to the Republican's opposition to him, according to the New York Times.

Bergdahl's lead defense lawyer, Eugene Fidell, requested a pre-emptive pardon that would preclude his client's trial on desertion and misbehavior charges. His trial is scheduled to start April 18, 2017. Fidell said if the case has not been approved by Inauguration Day, he will submit a motion to have it dismissed.

Trump railed against Bergdahl while on the campaign trail, calling him a "dirty, rotten traitor" and joked about shooting him for abandoning his troops.