Congressional investigators say the Pentagon broke the law when it swapped five Guantanamo Bay detainees for Sgt. Bowe Bergdahl.

Bergdahl, who was released in May, was being held by the Taliban for five years. The non-partisan Government Accountability Office (GAO) reports that the Pentagon failed to notify relevant congressional committees far enough in advance.

GAO also says that the financing of the swap breaks the Antideficiency Act, which is meant to keep agencies from spending more money than Congress has allowed.

After the transfer, Defense Secretary Chuck Hagel told lawmakers, “We made the right decision and we did it for the right reasons.”