WASHINGTON (AFP) - The US House of Representatives on Thursday approved a compromise bill to free up $162b for the wars in Iraq and Afghanistan, stripped of a timetable to pull US troops out of Iraq. The bill was approved after Democrats and Republicans hammered out a deal following weeks of partisan haggling, angering peace activists seeking a swift end to the war in Iraq. The legislation, which now goes to the Senate, would finance the military operations through mid 2009. Before the vote, White House Budget Director Jim Nussle said the bill "meets the president's requirements." The deal was reached after Democrats agreed to drop a withdrawal timetable from the bill. The majority party has repeatedly failed to force President George W. Bush's hand on Iraq since taking over Congress in 2006 elections. But Democrats insisted on inserting a modern version of the post-World War II GI Bill in order to expand education benefits to veterans, a plan that Senate Republicans and the White House had opposed. The war funding section of the bill passed by a 268-155 vote, with only 80 Democrats voting in favour along with 188 Republicans. The veterans' benefits part of the legislation, which also included a 13-week extension of unemployment benefits and aid for Midwest flood victims, was overwhelmingly approved, 416 to 12. The overall bill was approved in a voice vote. "This legislation is not perfect. No legislation is," said House Majority Leader Steny Hoyer. "But it will provide for our troops in the field, while addressing critical priorities here at home." House Republican Minority Leader John Boehner called the bill "a major victory for our troops and their families." House Speaker Nancy Pelosi defended the compromise, saying the priority was to protect the interests of US troops. "Well, first of all, you don't do everything in one bill," Pelosi said. "Now among those members who would not be happy about the bill not having date certain, count me among them." "The president simply will not sign such legislation," she said. "Our troops are in harm's way. They need to be taken care of." Meanwhile, in a late-term triumph for US President George W Bush, the US House of Representatives on Friday approved spy-powers legislation that has drawn heavy fire on civil liberties grounds. Lawmakers voted 293-129 for a bill that may shield telecommunications firms facing massive lawsuits over their work with Bush's secret, six-year, warrantless wiretapping programme, begun after the September 11, 2001 attacks. The measure now goes to the Senate, where Democratic Majority Leader Harry Reid has opposed granting retroactive immunity to companies that cooperated with a program thought to have skirted established surveillance laws. During often bitter House floor debate, many Democrats broke with the measure, the fruit of months of talks among Senate and House leaders of both parties that ultimately gave in to key White House demands. "It's Christmas morning at the White House thanks to this vote," said Caroline Fredrickson, a top official with the American Civil Liberties Union (ACLU) which has fiercely opposed the legislation. Earlier, Bush had used a hastily announced public statement at the White House to press lawmakers to approve new funding for the wars in Iraq and Afghanistan and pushed hard for House passage of the intelligence bill. "It's vital that our intelligence community has the ability to learn who the terrorists are talking to, what they are saying, and what they are planning," Bush said the two-minute statement.