The House of Representatives passed legislation Wednesday that aims to help 400,000 strapped US homeowners avoid foreclosures and prevent troubled mortgage giants Fannie Mae and Freddie Mac from collapsing. The House passed the bill by 272 votes to 152. The legislation will now be submitted to the Senate and President George W. Bush for his signature. The plan, which offers aid to homeowners facing foreclosure and seeks to restore confidence in mortgage finance giants Fannie Mae and Freddie Mac, cleared a major hurdle Wednesday when the White House dropped its threat to veto the plan, despite some reservations. The bill provides some $3.9 billion to help local governments buy and rehabilitate foreclosed homes. It also permanently boosts the dollar limit for mortgages that can be repurchased by Fannie Mae and Freddie Mac and expands the federal mortgage insurance program, moves that could add liquidity to the housing market. Significantly, the bill reforms Fannie and Freddie's oversight and would provide for new credit and direct federal investment in the government-sponsored enterprises, which have a congressional charter but are owned by shareholders. The measure is on track to pass the Senate and become law within days, after President George W. Bush dropped his opposition. The White House swallowed its distaste for $3.9 billion in grants the bill would provide for devastated neighborhoods, in exchange for a measure to rein in Fannie Mae and Freddie Mac, the government-sponsored mortgage firms, and the power to throw them a financial lifeline. Foreigners have millions of dollars invested in the two quasi-government agencies. The administration and lawmakers in both parties teamed to negotiate the measure, which also accomplishes top Democratic priorities, including federal help for homeowners, a new permanent affordable housing fund financed by Fannie and Freddie, and the $3.9 billion for hard-hit neighborhoods. The grants are for buying and fixing up foreclosed properties. Treasury Secretary Henry M. Paulson and lawmakers in both parties negotiated the final deal. It accomplishes several Democratic priorities, including aid for homeowners, a permanent affordable housing fund financed by the two mortgage companies and the money for hard-hit neighborhoods. The grants are for buying and fixing up foreclosed properties. “It is the product of a very significant set of compromises,” said Rep. Barney Frank, chairman of the House Financial Services Committee. “We are dealing with the consequences of bad decisions and inaction and malfeasance from years before,” said Frank, D-Mass. Paulson said he would push for enactment of the bill by week's end. Despite disappointment with some items rejected, he said “portions of this bill are orders of magnitude more important to turning the corner on the housing correction and supporting our markets and our economy.” In a policy statement on the bill, the White House said that parts of it “are too important to the stability of our nation's housing market, financial system, and the broader economy not to be enacted immediately.” Bush had objected to the neighborhood grants, saying that they would help bankers and lenders, not homeowners who are in trouble. Still, Dana Perino, the White House press secretary, told reporters in a conference call that a showdown with Congress over the funds would be ill-timed. But it was a striking split for Bush and congressional Republicans. Party leaders denounced the housing legislation as a bailout for irresponsible homeowners and unscrupulous lenders, even as they acknowledged it was probably necessary. “It's a bill that I wish I could support. It's a bill that the market clearly needs, ... but this is not a bill that I can support,” said Rep. John A. Boehner, the Republican minority leader. That 45 Republicans, mostly from districts ravaged by the housing crisis, voted “yes” reflected the political potency of the package at a time when economic worries are foremost in voters' minds. The measure hands the Treasury Department the power to extend the government-sponsored mortgage companies an unlimited line of credit and to buy an unspecified amount of their stock, if necessary, to prop up congressionally chartered Fannie Mae and Freddie Mac. The firms back or own $5 trillion in US mortgages, almost half the nation's total. Sen. Richard C. Shelby, the senior Banking Committee Republican who was his party's lead negotiator on the measure, said Bush's turnabout reflected political reality. “They counted some votes, and they see there's pretty broad support for this,” Shelby said. He and Sen. Christopher J. Dodd, the committee's Democratic chairman, said they would push for swift approval of the measure without change. “We'll be anxious to move this product along,” Dodd said. Conservative Republican senators were threatening to slow the measure, however, unless Democrats allowed a vote on barring Fannie Mae and Freddie Mac, whose political lobbying operations are legendary, from lobbying and making campaign contributions. Senators' objections could delay enactment of the measure until next week. Before Wednesday's vote, Treasury Secretary Henry Paulson told reporters that completing the measure was “a strong message that we are sending to investors” that would play a crucial role in “helping us turn the corner” on the housing crisis. Congressional analysts estimate that a government rescue of the mortgage giants could cost $25 billion, but they predict there's a better than even chance it will not be needed. The bill would let hundreds of thousands of homeowners trapped in mortgages they cannot afford on homes that have plummeted in value try to escape foreclosure by refinancing into more affordable, fixed-rate loans backed by the Federal Housing Administration. Lenders would have to agree to take a substantial loss on the existing loans, and in return, they would walk away with at least some payoff and avoid the often-costly foreclosure process. The plan also creates a new regulator with tighter controls for Fannie Mae and Freddie Mac and modernizes the FHA. It also increases the statutory limit on the national debt by $800 billion, to $10.6 trillion. Meanwhile, the International Monetary Fund on Thursday welcomed the US government's plans to aid mortgage finance giants Fannie Mae and Freddie Mac and ease the housing crisis. “The announced measures on Fannie and Freddie go in the right direction and are consistent with approaches that the Fund has supported,” IMF spokesman David Hawley said at a news conference. “And we agree that public sector intervention is warranted, accompanied by improved supervision.”