U.S. President George W. Bush has signed a war funding measure that will pay for the ongoing fighting in Iraq and Afghanistan and guarantee troop support well past his presidency.

Hailing the $162 billion US measure as a rare product of bipartisan co-operation, Bush said Monday at the White House: "This bill shows the American people that even in an election year, Republicans and Democrats can come together to stand behind our troops and their families."

He thanked specifically members of both parties in Congress and singled out some sponsors of the long-delayed, compromise measure for praise.

His positive comments were in contrast with the combative tone that has dominated the drawn-out debate between Congress and his administration over Iraq that took more than 500 days to conclude.

The legislation will bring the amount Congress has provided for the Iraq war since it began in 2003 to more than $650 billion US. For war operations in Afghanistan, the measure will bring the spending total to nearly $200 billion US, congressional officials said.

The measure approved by Congress also provides $2.7 billion US in aid for the U.S. Midwest, funds for expanding the GI Bill, anti-drug enforcement in Latin America and many other items.

The bill will fund troops well into next spring when their fate will be in the hands of the next U.S. president.

It also gives the next leader several months to set Iraq policy after taking office in January and spares lawmakers the need to cast more war funding votes closer to Election Day.

The Democratic majority in Congress has tried, unsuccessfully, to force troops to pull out of Iraq and place other limits on Bush's ability to conduct the war.

Many war opponents in Congress have expressed frustration and a sense of resignation at having to yield to Bush.

No lawmakers attended Monday's ceremony in the Oval Office, White House press secretary Dana Perino said, because "they're all out of town." Congress is currently in recess.

Democrats and Republicans support new GI Bill

The new GI Bill essentially will guarantee a full scholarship at any in-state public university, along with a monthly housing stipend, for people who serve in the military for at least three years. It is aimed at replicating the benefits awarded veterans of the Second World War and more than doubles the value of the benefit from $40,000 US today to $90,000 US.

The GI Bill measure had such extraordinary support from both Democrats and Republicans that White House objections were easily overridden. The bill also allows veterans to transfer their benefits to their spouse or a child, an idea Bush has championed.

The White House tried much harder to kill the effort to extend unemployment benefits as part of the war funding bill. But Bush's administration ultimately supported the compromise version, which requires people to have worked for 20 weeks in order to be eligible for the extended payments.

With files from the Associated Press