Congressional leaders have decided to allow detainees imprisoned at Guantanamo Bay, Cuba, to be brought to the United States to face civilian or military trials, legislative aides said Wednesday. The compromise, attached to $42.8 billion spending bill for the Homeland Security Department, would forbid the Obama administration from releasing detainees in the United States and would require advance notification to Congress when any detainee was sent to another country. The legislation, agreed upon by a committee of House and Senate leaders, must still be voted on by both the House and Senate. Congressional aides predicted that the legislation would pass, but the House voted resoundingly last week in favor of an advisory measure intended to forbid all transfers of detainees to the United States. The restrictions placed on the administration are nearly the same as the conditions imposed by Congress earlier this year. There are a few changes, including a requirement that would place the names of detainees on government no-fly lists and deny them immigration benefits. A White House aide said, 'Allowing transfers for trial is a positive development that will allow us to bring many of the detainees at Guantanamo Bay to swift and certain justice.' The aide added that discussions with Congress to close the prison would continue. It was not clear from summaries circulating Wednesday whether the legislation would allow detainees to serve prison sentences in the United States. In addition, it was not clear whether the compromise would permit detainees to be brought to the United States for indefinite detention. An undetermined number of detainees are deemed too dangerous to release but cannot be put on trial because there is insufficient evidence against them. Administration officials said recently that it was unlikely they would meet President Barack Obama's Jan. 22 deadline to close the prison. Obama's aides have declined to set another deadline as they struggle to find a places in the United States willing to accept detainees awaiting trial. There were more than 240 detainees at the Cuban detention center when Obama took office. Of those, about 90 have been approved for transfer to other countries and about 17 have already been sent overseas. About 40 others have been referred to trials before military tribunals or federal criminal courts. 