WASHINGTON – Up to half the terror suspects held at the U.S. military prison at Guantanamo Bay could be closer to heading home under a bipartisan deal reached in Congress that gives President Obama a rare victory in his fight to close the prison.

The deal would lift the most rigid restrictions that Congress previously imposed on detainee transfers overseas and is part of a broad compromise defense bill awaiting final passage in the Senate this week. The House approved the measure last Thursday.

Senate Armed Services Committee Chairman Carl Levin said the compromise could have a dramatic effect on the 160 detainees still being held at Guantanamo Bay, Cuba.

About half of the detainees could be transferred to their home countries, Levin said, and about half would remain in Guantanamo "because of the prohibition on transferring them to the United States for detention and for trial."

The defense bill marks the first time since Obama came to office promising to close Guantanamo that Congress is moving to ease restrictions. And it could signal changing political attitudes toward the prison for terrorism suspects now that the war in Afghanistan is winding down.

Obama's achievement was somewhat of a surprise, after the Republican-controlled House earlier this year voted overwhelmingly to make it harder to transfer detainees. But the deal to move in the opposite direction passed with hardly any opposition and little attention — perhaps overshadowed by more prominent defense bill debates over Iran sanctions, military sexual assaults and spying by the National Security Agency.

But even with the deal, Obama still faces big obstacles to closing Guantanamo. Congress has effectively blocked him from doing so for his first five years in office.

Yet the president seems determined as part of his legacy to push for closure of the prison he argues never should have been opened and "has become a symbol around the world for an America that flouts the rule of law."

Congressional proponents of keeping Guantanamo open say they felt they had to allow for transfers to other countries to maintain a ban on detainees from coming into the United States. The administration also pushed for the ability to transfer detainees to the U.S. for imprisonment, trial or medical emergencies but lost on that front, leaving Obama a thorny predicament of what to do with captives considered too dangerous to release.

Oklahoma Sen. James Inhofe, who worked on the compromise as the ranking Republican on the Senate Armed Services Committee, said he'll fight to keep Guantanamo open. "There's no place else you can house these terrorists," he said.