Congressional negotiators were near a deal on Thursday on a defense bill that would put into law a ban on the torture and inhumane treatment of detainees, a step the White House has opposed.

A congressional aide said House of Representatives Republicans had accepted the amendment pushed by Arizona Republican Sen. John McCain that swept through the Senate 90-9 despite fierce White House opposition.

House Armed Services Committee Chairman Duncan Hunter would not say whether the full McCain amendment would be in the final defense authorization bill. But the California Republican said it would accommodate “our ability to continue to harvest important intelligence in the war against terror and at the same time provide for a humane environment” for detainees.

Hunter, a White House ally, has said McCain’s amendment was unnecessary because there already were laws banning torture.

The White House has argued that putting the rules into law would hamper its ability to obtain information from prisoners by reducing their fear of the unknown.

But facing broad support in Congress for McCain’s amendment in the wake of abuses at Abu Ghraib prison in Iraq and harsh interrogation practices at Guantanamo Bay and elsewhere, the administration negotiated with the Senate on the final bill.

Hunter said he expected to have a bill “that will be embraced by all parties.” Rep. Ike Skelton of Missouri, the top Democrat on the Armed Services Committee, said he was “very optimistic at the end of the day we’re going to have an excellent bill.”

John Ullyot, a spokesman for Senate Armed Services Committee Chairman John Warner, a Virginia Republican, said he expected the final bill to be ready on Monday. It then faces final passage in the House and Senate as Congress scrambles to conclude business next week to break for the year.

A congressional aide said the package on detainees included the McCain amendment with no changes, and said other detainee-related amendments did not affect the McCain language.

The aide said it had made some changes to another Senate amendment to curb access to courts of terrorism suspects held at the U.S. prison at Guantanamo Bay, Cuba, but provide for appeals of their convictions to federal court.

White House and Senate negotiators were still working out language to give the administration some discretion in protecting covert agents from prosecution if they were found to have abused prisoners, aides said.

Hunter was also pushing to include language to have U.S. training of Iraqi forces include requiring humane treatment of prisoners. “We want to make sure that their training inculcates proper prisoner treatment as well as war-fighting capabilities,” Hunter said.