In 2013's first trading session, the S&P 500 was on target for its best percentage gain since Nov. 19 and highest close since Oct. 19.
The Dow Jones industrial average gained 229.64 points, or 1.75 percent, to 13,333.78. The Standard & Poor's 500 Index rose 26.53 points, or 1.86 percent, to 1,452.72.
The Nasdaq Composite Index jumped 74.26 points, or 2.46 percent, to 3,093.77.
U.S. markets were closed on Tuesday for New Year's Day. Nine stocks rose for every one falling on the New York Stock Exchange and all 10 of the S&P 500 industry sector indexes gained at least 1 percent. The S&P financial index was up 2.2 percent.
The S&P Information Technology index gained 2.1 percent, including Hewlett-Packard, which climbed nearly 5 percent to $14.95. HP's gain followed a miserable 2012 when the stock fell nearly 45 percent.
Congress passed a bill to prevent huge tax hikes and delay spending cuts that would have pushed the world's largest economy off a "fiscal cliff" and possibly into recession.
The vote avoided steep income-tax increases for a majority of Americans but failed to resolve a major showdown over cutting the budget deficit, leaving investors and businesses with only limited clarity about the outlook for the economy. Spending cuts of $109 billion in military and domestic programs were temporarily delayed, and another fight over raising the U.S. debt limit also looms.
"We got through the fiscal cliff. The next big thing, and probably more contentious thing, is negotiating the debt ceiling and possibly entitlement reform in early 2013," said Jim Russell, senior equity strategist for U.S. Bank Wealth Management in Cincinnati.
Hard choices about budget cuts and the critical need to raise the debt ceiling will confront Congress about the same time in two months "so the fur will be flying," Russell said.
U.S. stocks ended 2012 with the S&P 500 up 13.4 percent for the year, as investors largely shrugged off worries about the fiscal cliff. For the year, the Dow gained 7.3 percent and the Nasdaq jumped 15.9 percent.
Bank shares rose following news that U.S. regulators are close to securing another multibillion-dollar settlement with the largest banks to resolve allegations that they unlawfully cut corners when foreclosing on delinquent borrowers.
Bank of America Corp rose 3 percent to $11.95 and Citigroup Inc gained 3.7 percent to $41.03. The KBW bank index rose 2.4 percent and the S&P financial sector climbed 2.2 percent.
Shares of Zipcar Inc surged 48.2 percent to $12.21 after Avis Budget Group Inc said it would buy Zipcar for about $500 million in cash to compete with larger rivals Hertz and Enterprise Holdings Inc. Avis advanced 4.8 percent to $20.78.
Shares of Apple rose 2.5 percent to $545.56, helping to lift the S&P technology index up 2.3 percent following a report that the most valuable tech company has started testing a new iPhone and a new version of its iOS software.
Economic data showed U.S. manufacturing ended 2012 on an upswing despite fears about the fiscal cliff, but construction spending fell in November for the first time in eight months.