It took patience and nerves of steel, but investors in US markets who held their positions through rocky December got their reward in the new year's opening week.
A long-awaited political deal to head of the fiscal cliff finalized on the Tuesday New Year's Day holiday sparked a huge rally that delivered the S&P 500 to its highest level in five years with a near 4.6 percent gain for the week.
Just on the January 1 deadline for steep spending cuts and tax hikes to kick in -- that could have sent the world's biggest economy back to recession -- warring Democrats and Republicans agreed to pull away from the cliff.
Their deal still pushed up tax rates for the richest two percent in the United States, increased dividend and capital gains taxes generally, and increased paycheck deductions for social security for all workers.
Those would have normally been seen as bad for markets. But that outcome was still much better than could have been, removing much of the nervousness that killed a year-end rally in December.
A modest rise on Friday gave the Dow Jones Industrial Average a 3.8 percent gain for the whole week, ending at 3,435.21.
The broad-based S&P 500 did better, up 4.57 percent to 1,466.47. And the Nasdaq, which was flat on Friday, reaped a 4.77 percent gain for the week, to 3,101.66.
Most of the gains came on Wednesday, the deal having been achieved in the House of Representatives in the late hours of the previous day. The S&P added 2.5 percent and the Nasdaq 3.1 percent on Wednesday.
That was matched by a global New Year's rally, that showed just how much investors in other markets worldwide had been worried about the grinding economic policy stalemate in Washington.
"The fiscal cliff had dominated the agenda for both markets and US lawmakers in the run-up to Christmas, but with this now seemingly averted, equities are poised to break higher as the 2013 trading year gets underway," noted analyst Fawad Razaqzada at GFT Markets.
The gains were felt across the board. Strong auto sales in December also helped push Ford and General Motors higher, and Google received an added boost when US investigators gave up in their anti-trust probe of the company.
But analysts were not certain that gains could be upheld in the coming weeks, because the fiscal cliff deal did not resolve other key issues of the US deficit.
Scheduled sharp "sequestration" spending cuts that Republicans are demanding were put off for two months, and a much-needed increase in the country's debt ceiling -- already hit on Monday -- was not agreed.
Both issues spell more political wrangling and brinksmanship in the coming weeks.
"Unfortunately, we're not out of the woods in terms of the grip Washington DC has on the economic, market and psychological outlook, given that the debt ceiling and spending fights will still rage over the next couple of months," said Liz Ann Sonders of Charles Schwab.
"We really just crossed a bridge to the other side and are now facing the debt ceiling/sequestration cliff."
"The debt ceiling already has been breached, with temporary moves by Treasury putting off an actual default until late February-early March," said Linda Duessel of investment manager Federated.
"Without adult supervision, the markets will be forced to be the disciplinarians, setting the stage for increased market volatility and greater uncertainty for what could be months."
Even before that, fourth quarter corporate results will be setting the pace: Monsanto and Alcoa launch the earnings season on Tuesday.
Investors will be hoping for profits that continue to support the indices at their current level, said Sam Stovall of Standard and Poor's Capital IQ.