WASHINGTON — The Obama administration broke the law when it swapped five Guantanamo Bay prisoners for Army Sgt. Bowe Bergdahl, a federal watchdog said Thursday.

The nonpartisan Government Accountability Office said the trade that freed the POW this spring violated the Department of Defense Appropriations Act because Congress wasn’t given the required one-month notice.

The GAO also said the Defense Department’s use of $988,400 to transfer the Taliban prisoners to Qatar violated the Antideficiency Act because the funds hadn’t been expressly appropriated.

“In our view, the meaning of the [law] is clear and unambiguous,” the GAO wrote to nine Republican senators who requested the legal opinion.

“Section 8111 prohibits the use of ‘funds appropriated or otherwise made available’ in the Department of Defense Appropriations Act, 2014, to transfer any individual detained at Guantanamo Bay to the custody or control of a foreign entity except in accordance” with the law.

The Defense Department will now report the violation to Congress and the White House.