Congressional leaders agreed Wednesday on a compromise $789 billion economic stimulus package that President Barack Obama says is needed to create millions of jobs and to pull the economy out of recession. It was a big victory for the new president, who has been campaigning energetically for the legislation in recent days, saying it was essential to avoid having the worst economic crisis in a generation turn into a catastrophe. It was not immediately clear when the Senate and House of Representatives would vote on the compromise measure. A House vote was possible as early as Thursday, with the Senate to follow before lawmakers begin a scheduled weeklong vacation. Obama was expected to sign the legislation immediately after Senate passage. Calling the final deal a "hard-fought compromise," Obama said in a statement he was grateful to Congress for working urgently on a deal he said could save or create more than 3.5 million jobs. In announcing Wednesday's deal, Senate Majority Leader Harry Reid said marathon talks starting Tuesday produced a compromise between the differing bills passed earlier by the Senate and House. The talks often were joined by White House officials. "The middle ground we've reached creates more jobs than the original Senate bill and costs less than the original House bill," Reid said. The bill includes help for victims of the recession in the form of unemployment benefits, food vouchers for the poor, health coverage and more, as well as billions for states that face the prospect of making deep cuts in their own programs. It also preserves Obama's signature tax cut - a break for millions of lower and middle income taxpayers, including those who don't earn enough to pay income taxes. There's also as much as $44 billion in aid for states, which have been hard-hit by the economic downturn. Sen. Max Baucus, a Democrat from Montana and one of the negotiators, said earlier that 35 percent of the total would be in the form of tax cuts. One change reduced Obama's tax credit for workers to $400 from $500, with couples eligible for an $800 credit, instead of $1,000, said a Democratic aide close to the talks. This aide spoke on condition of anonymity because the negotiations are private. Both the House and Senate measures contained "Buy American" language that would restrict spending to US-produced iron and steel for stimulus projects. It was not immediately clear if that was changed in the compromise negotiations. Obama has voiced concern that the provision could provoke a trade war. Work on the stimulus bill came as the Obama administration continued to work on details of the other part of its strategy to revive the economy: a bailout plan, costing up to $2 trillion, to rescue the American banking system. That unprecedented figure would include a mixture of government and private sector money designed to rid bank balance sheets of toxic investments and thaw frozen credit markets. But a lack of detail about the bailout program, which was announced by Treasury Secretary Timothy Geithner, and questions about whether the private sector would sign on sent major US stocks indexes tumbling about 4.5 percent on Tuesday. Stocks rebounded weakly on Wednesday despite announcement of the compromise on the stimulus bill. Obama's chief spokesman, Robert Gibbs, downplayed Tuesday's 382-point drop in the Dow Jones industrial average. He said the administration's bailout plan that sent Wall Street tumbling was not designed for a "one-day market reaction." Gibbs said previous economic plans sent the markets up but ended up being failures and that the Obama administration was looking at a broader fix. Lawmakers from both parties have been critical of the initial $700 billion bank rescue plan, started under former President George W. Bush. Questions remain about how the money was spent and there is little sign it has loosened credit markets. At a hearing Wednesday, Geithner said it was too early to say how much taxpayer money the Obama administration's bank rescue plan ultimately will cost, but he told the Senate Budget Committee that further requests are possible. At a separate hearing, eight chief executives of US banks told the House Financial Services Committee they would try to cooperate more closely with Congress. "Both our firm and our industry have far to go to regain the trust of taxpayers, investors and public officials," John J. Mack, head of Morgan Stanley, told the committee. Added JPMorgan Chase & Co.'s Jamie Dimon: "We stand ready to do our part going forward."