President Obama praised lawmakers and Vice President Joe Biden after the House of Representatives voted to pass a Senate measure to avert the most serious impacts of the so-called fiscal cliff.

Updated at 12:32 a.m. ET: An agreement to stave off the harshest and most immediate consequences of the fiscal cliff won approval in the House late Tuesday. President Barack Obama signed the law on Wednesday night, the battle over which foreshadowed more fights with Congress over spending.

Following a day of hectic wrangling on Capitol Hill — where the prospects for passing the bipartisan, Senate legislation regarding the fiscal cliff hung in the balance for much of New Year's Day — the House voted 257 to 167 to pass the belated compromise measure over the objections of many conservative Republicans.

The legislation takes steps toward resolving the combination of automatic tax hikes and spending cuts that took effect at midnight on Jan. 1. It preserves tax rates as they were at the end of 2012, except for those individuals earning more than $400,000 and households earning over $450,000. It also allows taxes on capital gains and dividends to go up, and extends benefits of the unemployed. Additionally, the Senate bill delays the onset of the "sequester" — the swift, automatic spending cuts — for two months.

Fiscal cliff compromise leaves few satisfied

"Thanks to the votes of Democrats and Republicans in Congress I will sign a law that raises the taxes on the wealthiest of Americans," Obama said in remarks at the White House Tuesday, "while preventing a middle-class tax hike."

The House vote laid bare some of the internal ideological divisions to plague the GOP over the past two years. More Republican congressmen (151) voted against the Senate bill than for it (85), meaning that Democrats' support was needed to advance the final deal. House Speaker John Boehner, R-Ohio, took the rare step of casting a vote, and did so in favor of the legislation. Rep. Paul Ryan, R-Wis., the former Republican vice presidential nominee, also supported the package. But Boehner's top two lieutenants, Majority Leader Eric Cantor, R-Va., and Majority Whip Kevin McCarthy, R-Calif., each opposed the deal.

The House voted Monday to approve the Senate's fiscal cliff bill by a vote of 257-167. Richard Lui, Luke Russert and Mike Viqueira report on MSNBC.

"Now the focus turns to spending," Boehner said in a statement following the House vote. "The American people re-elected a Republican majority in the House, and we will use it in 2013 to hold the president accountable for the ‘balanced’ approach he promised, meaning significant spending cuts and reforms to the entitlement programs that are driving our country deeper and deeper into debt."

While the last-minute action on Capitol Hill essentially mitigates much of the risk posed to the U.S. economic recovery by the fiscal cliff, it hardly brings resolution to the bitter and often intractable fight in Washington over taxes and spending. The first half of 2013 will feature battles in Congress over raising the debt limit, continuing basic government funding and the expiration of this two-month delay in the sequester.

Bipartisan outrage after House skips vote on $60 billion Sandy aid bill

Obama nodded to those looming fights in his remarks Tuesday evening, renewing his call for "balance" in any solution in the coming year to address deficits and debts. But the president also sternly warned Congress against using the debt ceiling as a bargaining chip, as Republicans had in summer of 2011.

"While I'll negotiate over many things, I will not have another debate with this Congress over whether to pay the bills they have racked up," Obama said.

PhotoBlog: Deal done, Obama heads back to Hawaii with a weary wink

The fiscal cliff itself was the product of discord in Congress resolving those very issues. And the difficulty in attaining even this less ambitious piece of legislation — versus the kind of "grand bargain" Obama had first sought in talks with Republicans — offered a cautionary tale for the 113th Congress, in which the House and the Senate remain controlled by the same parties as during the past two years.

Squabbling

And even for much of Tuesday, House approval of the fiscal legislation — which was negotiated by Senate Minority Leader Mitch McConnell, R-Ky., and Vice President Joe Biden — was far from certain. GOP leaders were forced to cajole conservatives who complained the fallback deal contained insufficient spending cuts. Only after it became clear that Republicans wouldn't have the votes to amend the Senate proposal — which the upper chamber said it wouldn't even consider — did House Speaker John Boehner, R-Ohio, bring the bill to the floor.

The squabbling was familiar to any observers of Congress during the past two years. This divide almost resulted in a government shutdown and a default on the national debt in 2011. It again threatened Tuesday to allow the painful, across-the-board tax hikes and spending cuts to play out just as the U.S. economic recovery showed signs of accelerating.

PhotoBlog: See images of Congress working overtime to avoid fiscal cliff

And this deal just approved by Congress in the waning hours of 2013's first day all but ensures that much of the coming year will be dominated by similar battles in Washington. Republicans are hopeful they might be able to extract more spending cuts and entitlement reforms with the government up against other deadlines, like the one needed this spring to authorize more government borrowing.

That could complicate Obama's already-ambitious second term agenda. The president said just this past Sunday on NBC's "Meet the Press" that he will seek comprehensive immigration reform legislation and new laws to address gun violence.