Congress is acting swiftly to send President Bush a military bill that bans cruel, inhuman and degrading treatment of terrorism suspects in U.S. custody and sets uniform interrogation guidelines for American troops.

The sweeping measure setting Pentagon policies and funding levels also includes a military pay raise and allows an Iraq war veteran to adopt a bomb-sniffing dog named Rex.

Before dawn Monday, the House passed the bill 374-41, and Senate passage was expected this week. The detainee provisions also are included in a separate $453 billion military spending bill that is making its way through Congress and provides $50 billion for wars in Iraq and Afghanistan.

Bush is expected to sign both measures when they reach his desk.

The prisoner legislation sponsored by Sen. John McCain, R-Ariz., seeks to standardize interrogation techniques and repair a tarnished U.S. image abroad.

After months of resistance that included White House veto threats, Bush bowed to pressure from Congress and signed off on it — a recognition that McCain had the votes in both the House and Senate to override any veto.

Sen. John Warner, R-Va., and chairman of the Senate Armed Services Committee, said the detainee provisions put U.S. policy into law and will "further protect members of our military and their civilian counterparts as they perform vital intelligence operations."

The top Democrat on the panel, Sen. Carl Levin of Michigan, said the provisions "should help restore America's reputation around the world."

The legislation would prohibit "cruel, inhuman or degrading treatment or punishment" of anyone in U.S. government custody anywhere in the world. It also would require that service members follow procedures in the Army Field Manual during interrogations of prisoners in Defense Department facilities.

Under an agreement with the president, McCain added that civilian interrogators accused of violating the standards would get the same legal protections as those afforded to military interrogators.

That addition was modeled after the Uniform Code of Military Justice, which says military personnel accused of violating interrogation rules can defend themselves if a reasonable person could have concluded they were following a lawful order. Those rights would be extended to CIA interrogators under the agreement.

Other provisions are specific to terror-war prisoners at the U.S. naval base at Guantanamo Bay, Cuba. They would be permitted to appeal their detention status and punishments to a federal appeals court in Washington.

That avenue would replace the one tool the Supreme Court gave detainees in 2004 to fight the legality of their detentions — the right to file habeas corpus lawsuits in any federal court. Detainees declared enemy combatants — those currently at Guantanamo Bay and those who have been released — also would be barred from filing any other kind of legal action against the United States or its officials.

Another provision would allow military panels determining whether to hold detainees indefinitely to consider information gained from coercive interrogation techniques. Human rights groups say that would undermine McCain's ban.

Sweeping in scope, the bill authorizes a 3.1 percent pay raise for military personnel and allows exceptions to the law that prohibits the adoption of military working dogs before the end of their useful life.

The latter provision was added after lawmakers learned of the case of Air Force Tech Sgt. Jamie Dana, severely injured when her Humvee was bombed in Iraq but rebuffed when she sought to adopt Rex the dog.

The Air Force initially said it spent thousands of dollars training Rex, and by law he needed to work the remaining five years of his useful life. But lawmakers say Dana would get to adopt Rex under the provision in the bill.

Also included are provisions:

—Increasing the number of active duty Army personnel by 10,000 and the number of active duty Marines by 1,000.

—Boosting enlistment and re-enlistment bonuses.

—Requiring the Navy to maintain 12 aircraft carriers.

—Authorizing an increase in the maximum enlistment age for active duty troops from 35 to 42 years.