Moving at lightning speed and, even more unexpectedly, ahead of their President's Day deadline, House and Senate negotiators agreed on the details of a $789 billion stimulus package barely 30 hours after the Senate passed its version. In the process, they handed President Barack Obama his first major legislative victory, though the deliberations that led up to its passage highlighted the enormous challenges Obama will face in more complicated endeavors like health-care, entitlement and energy reform.

The Senate Democratic leadership was so anxious to declare victory that they ran to announce the news before their House counterparts had fully signed off. "The difference between the Senate and House versions were resolved," Senate majority leader Harry Reid told a throng of reporters on Wednesday afternoon. "The bills were really quite similar. And I'm pleased to announce that we've been able to bridge those differences." (Read "How to Know When the Economy Is Turning Up.")

Problem was, the House Democrats weren't resolved. Their initial hesitancy to sign on reflected their frustration at the cuts to state aid and education dollars that were made to woo the crucial votes of three Republican Senators as well as moderate Democrats. Three hours and a few tweaks later, House Speaker Nancy Pelosi finally announced her support. "We're having a very  shall we say  highly spirited caucus right now, people's spirits are high," Pelosi said, emerging from a meeting of House Democrats. "They're very proud of the work that we did in the House to create up to 4 million new jobs." The deal could come to a vote in the House as early as Thursday and before the end of the week in the Senate.

The final hiccup in a three-week process that was full of hiccups was over the approximately $10 billion added to the state-stabilization fund that House Democrats wanted to see directed toward school construction. The three Senate Republicans  Maine Senators Olympia Snowe and Susan Collins and Arlen Specter of Pennsylvania, without whose votes the bill would not have passed the Senate  wanted to leave how the funds would be spent up to governors. Ultimately, the two sides agreed to allow governors the option of spending the money on school construction but not limit the money to that. "There's no question that one of our overriding priorities in the House was a very strong commitment to school construction," Pelosi said. "I would have liked it to be its own item, but the fact is that the outcome that we have is a good one as well." (See who's to blame for the financial crisis.)

The bill is expected to draw at least a few GOP votes in the House, reflecting just how far to the center the measure has moved in passing the Senate. The final cost, $789 billion, is well below the $800 billion ceiling that the three Republicans and a group of 15 centrist Senate Democrats had demanded in exchange for their support. Even so, House Republicans complained bitterly about being left out of the process. "Some have said that we don't want to see anything done. Nothing could be further from the truth," said Representative Eric Cantor, the No. 2 House Republican. "I don't think you're going to find a Republican in the House who says he or she doesn't think we need to act on a stimulus now. We're just concerned that the actions being talked and discussed about in this conference committee is action that we will later regret, action that possibly could do more harm than good to get us out of the economic crisis that we're in."

No Republicans voted for the House bill, and the meager GOP support in the Senate  just those three votes  prompted Republican complaints that the Dems were not living up to Obama's campaign promise of bipartisanship. But in voting en masse against the bill, the GOP is making a risky long-term bet, said Clyde Wilcox, a political science professor at Georgetown University. "The GOP is gambling here that the stimulus does not work, and they can make big gains in 2010. Given the sticky economy, that is certainly a possibility," Wilcox said. "But all it took for Ronald Reagan in 1984 was for the economy to turn the corner, and he was re-elected easily."

Obama, whose chief of staff, Rahm Emanuel, and legislative liaison Phil Schiliro personally oversaw the negotiations on the Hill, hailed the agreement, saying it will help companies like Caterpillar, which announced 20,000 layoffs last month. "Just today, the CEO of Caterpillar said that if this American Recovery and Reinvestment Plan is passed, his company would be able to rehire some of the employees they've been forced to lay off," Obama said. "It's also a plan that will provide immediate tax relief to families and businesses, while investing in priorities like health care, education, energy and infrastructure that will grow our economy once more."

The ahead-of-schedule victory gives Obama a massive running start on much of his campaign promises, from investments in clean energy and education to health-care reform. But given how hard it was for the President to win the backing of enough members of his own party, let alone the GOP, the stimulus fight showed the limits of his seemingly enormous electoral mandate. Many Democrats, for instance, felt the White House tried too hard to win the favor of Republicans, who in the end didn't lend their support. "I am not happy with it," said Senator Tom Harkin, Democrat of Iowa. "You are not looking at a happy camper. I mean, they took a lot of stuff out of education. They took it out of health, school construction, and they put it more into tax issues."

The final bill comprises about 35% in tax cuts and 65% in spending, including more than $150 billion for infrastructure projects. The conferees removed $68 billion in business tax cuts that would have let companies write off recent losses, and a home-buyers' credit of $15,000 was reduced to $8,000. A provision to help car buyers write off their interest payments was also reduced, to $2 billion from $11 billion. The bill does include a $70 billion annual Alternative Minimum Tax relief patch to prevent millions of middle-class Americans from getting penalized by a measure that was originally targeted at the rich. Reid on Wednesday boasted that the measure will cut taxes for 95% of workers, though the final agreement trimmed Obama's proposed tax rebates of $500 a year for individuals and $1,000 for families to $400 and $800, respectively.

Also included is $54 billion in aid for states, many of which have already been forced to dramatically scale back services. Still, some critics say this may not be enough. "State and local governments, in particular, were hoping for much more aid, and they'll undoubtedly be back as their own budgets sag," said Don Kettl, a political science professor at the University of Pennsylvania. The bill includes $59 billion to help unemployed workers and extends aid for their health insurance. Ninety billion dollars will go toward shoring up Medicaid, $19 billion is allocated for Obama's "down payment" on modernizing health-care records  short of the $25 billion he originally envisioned  and onetime payments of $250 will be made for senior citizens, disabled veterans and disabled workers.

"Obama wins, big," said Greg Valliere, chief political strategist for Stanford Washington Research Group. "He needed a victory. The GOP got some sound bites for 2010 if this doesn't boost the economy, but they looked obstructionist and negative." Still, if the $789 billion stimulus was a tidal wave, the next item on Obama's to-do list is a tsunami  a $2.5 trillion bank bailout. Fortunately for the President, little of that plan requires congressional action. Unless  or until  the Administration ends up needing more money for it, at which point no one will expect Congress to move as rapidly as it did this week.