The Obama administration spent nearly $1 million in May to send five Taliban Guantanamo detainees to Qatar in exchange for Army Sergeant Bowe Bergdahl, a prisoner of war of who was held in captivity by militants for five years. And that prisoner swap violated the law.

So said the Government Accountability Office (GAO), the nonpartisan research arm of Congress, in a seven-page review requested in June by Republican lawmakers.

The GAO found that the Obama administration violated a provision in a Defense bill restricting the use of funds for the transfer of Guantanamo detainees unless Congress receives 30 days' written notice. The conditions of detainee transfers also requires the Secretary of Defense to outline to Congress the steps the administration has taken to ensure the detainee is not engaging in terrorist activities against the United States.

"In addition, because DOD used appropriated funds to carry out the transfer when no money was available for that purpose, DOD violated the Antideficiency Act," the GAO said in the letter signed by the agency's top lawyer, Susan Poling. "The Antideficiency Act prohibits federal agencies from incurring obligations exceeding an amount available in an appropriation."

GAO said the Defense Department did not notify Congress about the Taliban-Bergdahl exchange until May 31, the day he was rescued in Afghanistan by special operations forces. The $988,400 the Pentagon spent to transfer the Taliban five came from the Army's Operations and Maintenance appropriation. (It costs about $2.5 million to keep a single prisoner in Gitmo for one year.) GAO said the Pentagon should report its Antideficiency Act violation along with a statement of facts to the President, Congress, and the Comptroller General as required by law.

The Pentagon, meanwhile, has a somewhat different interpretation of the law.

"As Secretary [of Defense] Hagel has testified before Congress, the recovery of Sergeant Bergdahl was conducted lawfully," said Pentagon press secretary Rear Admiral John Kirby. "This decision was made after consultation with the Department of Justice. The Administration had a fleeting opportunity to protect the life of a US service member held captive and in danger for almost five years. Under these exceptional circumstances, the Administration determined that it was necessary and appropriate to forego 30 days' notice of the transfer in order to obtain Sergeant Bergdahl's safe return."

'The executive branch must have the flexibility, among other things, to act swiftly in conducting negotiations with foreign countries regarding the circumstances of detainee transfers.'

A senior defense official, in an email to VICE News, reiterated the Pentagon's disagreement with GAO's conclusion.

"The administration, after consultation with the Department of Justice, concluded that the transfer could lawfully proceed in the exercise of the President's constitutional authority," the defense official said. "GAO expressly does not address the lawfulness of the administration's actions as a matter of constitutional law."

Caitlin Hayden, a White House National Security Council spokeswoman, told VICE News that Bergdahl's rescue and the transfer of the Taliban five was the "result of unique and exigent circumstances," and "due to a near-term opportunity to save his life, the Administration moved as quickly as possible and determined that the transfer should go forward notwithstanding the notice requirement" to Congress.

Obama issued a "signing statement" after he signed a separate piece of legislation into law that explained the conditions he must adhere to before transferring Guantanamo detainees. He noted in the statement that the transfer restrictions imposed by Congress in that bill would, "in certain circumstances, violate constitutional separation of powers principles."

"The executive branch must have the flexibility, among other things, to act swiftly in conducting negotiations with foreign countries regarding the circumstances of detainee transfers," Obama's signing statement attached to the bill said. "Of course, even in the absence of any statutory restrictions, my Administration would transfer a detainee only if the threat the detainee may pose can be sufficiently mitigated."

Democrat and Republican lawmakers alike were critical of the prisoner exchange, and vowed to block efforts by the administration to repatriate or transfer other Guantanamo detainees and close the detention facility.

Senator Saxby Chambliss, the vice chairman of the Senate Intelligence Committee, said in a statement in which he accused Obama of routinely violating the law that the GAO's findings may result in "sanctions" and "administrative discipline," which includes "suspension from duty without pay or removal from office for federal employees."

"In addition, employees may also be subject to fines, imprisonment, or both," Chambliss said. But that seems unlikely.

Last June, Chambliss called on Obama to declassify intelligence about the Taliban five, much of which had already been released by Wikileaks years ago. The White House has not disclosed any additional information about the former Guantanamo detainees or the Bergdahl operation.

Numerous lawmakers were reportedly aware that the White House for years had considered trading the Taliban five for Bergdahl, and had even inquired about the administration's efforts to secure his release

A draft report following the Army's investigation into Bergdahl's disappearance is expected to be complete sometime next month; it will determine whether or not Bergdahl deserted his platoon or was absent without leave, which could lead to criminal charges. Some members of Bergdahl's platoon claim he is a deserter, and rescue missions mounted by his unit after he disappeared led to the deaths of other soldiers.

Follow Jason Leopold on Twitter: @JasonLeopold