WASHINGTON (AP) – President Barack Obama on Wednesday signed a $607 billion defense policy bill despite his opposition to restrictions in the legislation that ban him from moving Guantanamo Bay detainees to the United States and making good on a long unfulfilled campaign promise.

Obama has opposed provisions preventing detainee transfers since Congress first attached the measures to spending bills in an attempt block Obama’s plans. The dispute has taken on added intensity this year because the White House has launched a final push to close to the prison before Obama leaves office.

In a statement, Obama said the bill "includes vital benefits for military personnel and their families, authorities to facilitate ongoing operations around the globe, and important reforms to the military retirement system" as well as other measures.

He added, however, that he is "deeply disappointed that the Congress has again failed to take productive action toward closing the detention facility at Guantanamo." Keeping the prison open, Obama said, "is not consistent with our interests as a Nation and undermines our standing in the world."

The White House and the Pentagon are preparing to send to Congress a plan outlining more precisely how it would shutter the prison and where in the U.S. might transfer detainees. The proposal, however, was not expected to overcome sizable opposition among Republicans and some Democrats.

That’s put the defense policy bill at the center of the debate over whether Obama would move some detainees from the detention center in Cuba to U.S. facilities without congressional approval. Some legal experts and Obama administration allies argue the restrictions are unconstitutional and are urging Obama to move the detainees and close the prison despite the provisions. The White House has said it is focused on working with Congress, but has not ruled out other options.

"As I have said repeatedly, the executive branch must have the flexibility, with regard to the detainees who remain at Guantanamo, to determine when and where to prosecute them, based on the facts and circumstances of each case and our national security interests, and when and where to transfer them consistent with our national security and our humane treatment policy," Obama said in the statement.

But after Obama signed the bill, House Speaker Paul Ryan, R-Wis., said his approval "reaffirms longstanding prohibitions on the transfer of Guantanamo Bay detainees to the United States."

The legislation will guide Pentagon policy for nearly all of the remainder of Obama’s tenure. In addition to the detainee ban, it includes a 1.3 percent pay increase for service members, authorization for lethal assistance to forces fighting Russian-backed rebels in Ukraine and funding to help Iraqi forces fight Islamic State militants.

Obama vetoed an earlier version of the bill over a dispute – later resolved – about the way defense programs would be financed. He did not repeat the threat over the Guantanamo provisions, mindful that he would not have the votes to sustain a veto. The legislation passed with overwhelming support in both the House and Senate approval.

The White House announced the signing Wednesday afternoon along with five other bills.

Copyright 2015 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.

Join our Newsletter for the latest news right to your inbox