U.S. investors celebrated New Year's Eve believing lawmakers had finally gotten together in a last-ditch effort to avert the "fiscal cliff."

For a time, it appeared Tuesday's deliberations in the House of Representatives would be the equivalent of a rough hangover.

Members of Congress uncomfortable with a deal brokered between Senate Republicans and the White House threatened to scuttle the deal, which could have hit Wall Street hard after its rally to end 2012 on Monday.

With the House looking likely to vote on the Senate bill that avoids - for now - most of the consequences of the fiscal cliff, Wall Street is well-positioned to begin 2013 with a rally, even if thorny issues remain to be ironed out in the coming months in Washington.

"It does seem that we are finally edging closer to a deal that has market-friendly broad outlines and that should be market positive," said Bill Stone, chief investment strategist at PNC Asset Management Group in Philadelphia.

The Standard & Poor's 500 stock index ended the year up 13 percent, its best gain since 2009, mostly shrugging off the debt-related worries that dominated headlines during the year.

Equity markets held up in the last two months of the year as well, expecting a resolution to head off $600 billion in spending cuts and tax hikes that could push the economy into recession if they stay in effect for long. While the deadline to avert the cliff was December 31, legislation can be formulated to retroactively prevent going over.

The back-and-forth in recent weeks has primarily been of concern to businesses, where confidence has eroded. Some slowing in economic growth due to the impasse is expected, but that may play into the hands of value investors if the market corrects in coming months.

"It appears as though politics will dominate for some time," said Richard Bernstein, chief executive of Richard Bernstein Advisors in New York. "That being said, equity market valuations already reflect this... the stock market is attractive from my perspective."

Stock markets around the world were closed Tuesday because of New Year's Day. One of the first key gauges of the market's reaction to headlines on the "fiscal cliff" will come when futures reopen early on Wednesday. Some Republicans in the House had expressed concern on Tuesday afternoon that a bill would not be finished before the open of U.S. markets.

The MSCI Asia Pacific ex-Japan index of stocks was up 1.6 percent.

Many traders will still be away from their desks because of the holiday, indicating trading volume will stay near its recent low levels. The anemic action, coupled with uncertainty over the cliff, resulted in a spike of volatility in December, with the CBOE Volatility index jumping 13.5 percent in the month.

The Senate bill working its way through the House of Representatives does not contain the kind of spending cuts that many conservative Republicans favor in order to bring down the high U.S. federal debt.

Even as this battle recedes, markets will look ahead to another fight in the next few months, this time over whether Congress will approve an increase in the U.S. debt ceiling.

The White House has said it will not negotiate the debt ceiling as in 2011, when the fight over what was once a procedural matter preceded the first-ever downgrade of the U.S. credit rating. But it may be forced into such a battle again. A repeat of that war is most worrisome for markets.

"The spending side fight looms and it will be tougher," said David Kotok, chairman and chief investment officer at Cumberland Advisors in Sarasota, Florida. "The Republican caucus is tighter on that side."

Markets posted several days of sharp losses in the period surrounding the fight in 2011. Even after a bill to increase the ceiling passed, stocks plunged in what was seen as a vote of "no confidence" in Washington's ability to function, considering how close lawmakers came to a default.

This time around, the markets have been much less volatile, largely because the effects of the spending cuts and tax hikes will be gradual, and there was an ongoing expectation that a retroactive fix was in the offing.

On Monday, however, Wall Street ended 2012 with its best day in more than a month as it appeared lawmakers were closing in on a deal.

"When you separate the fundamentals of the economy from the headlines, the fundamentals really suggest we can support higher prices in the new year," said Bill Vaughn, equity portfolio manager at Evercore Wealth Management in San Francisco. "Resolving the cliff could be the fuse that starts a rally that wants to start."

(Reporting by Ryan Vlastelica; additional reporting by David Gaffen, David Randall, Chuck Mikolajczak and Richard Leong; Editing by Neil Fullick)