Stocks rallied on Wednesday as upbeat economic data out of China and Germany eased concerns about the global economy and Greece neared a long-delayed deal on a debt swap.

A weak outlook from Internet heavyweight Amazon limited gains on Nasdaq.

China's factory sector expanded slightly in January, confounding expectations for a contraction and supporting hopes the world's second biggest economy will avoid a hard landing. Separately, Germany recorded its first rise in manufacturing output in seven months.

U.S. economic data was mixed. The pace of growth in the U.S. manufacturing sector picked up in January to its highest level since June as new orders improved.

But the ADP National Employment Report showed the pace of private sector job creation slowed more than expected in January after a sharp gain the month before.

The Dow Jones industrial average <.DJI> jumped 135.74 points, or 1.07 percent, at 12,768.65. The Standard & Poor's 500 Index <.SPX> was up 13.42 points, or 1.02 percent, at 1,325.83. The Nasdaq Composite Index <.IXIC> rose 19.74 points, or 0.70 percent, at 2,833.58.

The market is bullishly higher, given the strong data from China and Europe, ADP may have tempered some enthusiasm and set up some trepidation for what Friday's (government) payroll report might hold, said Mark Luschini, chief investment strategist at Janney Montgomery Scott in Philadelphia. There is brinksmanship between the optimism and a reserved posture for the labor market. Inc slid 9.5 percent to $176, limiting gains on the Nasdaq a day after the online retailer warned of a possible first-quarter loss and posted a steep drop in fourth-quarter profit.

Banks continued to rally on signs of euro zone progress. U.S.-traded shares Deutsche Bank climbed 4.2 percent to $44.51 while Citigroup Inc rose 2.9 percent to $31.61 and Morgan Stanley added 4.5 percent to $19.48.

Greek Finance Minister Evangelos Venizelos said talks between Greece and its private creditors were one formal step away from a deal needed to avoid a messy default.

Earnings continued to be a mixed bag. According to Thomson Reuters data, of the 204 companies in the S&P 500 that have reported results so far, 59.8 percent topped estimates, tracking below the beat rate at this stage of the earnings season in recent quarters.

Aetna Inc posted sharply higher quarterly profit in line with Wall Street's target, sending shares up 3.3 percent to $45.16.

Whirlpool Corp surged 11 percent to $60.32 after giving an optimistic full-year outlook.

Facebook is expected to submit paperwork to regulators Wednesday morning for a $5 billion initial public offering and selected Morgan Stanley and four other bookrunners to handle the mega-IPO, sources said told Reuters unit IFR.

Despite the gains, recent market action suggested they could be ephemeral, with continued vo1latility and lower trading volume adding to the mix.

(Reporting by Ryan Vlastelica; editing by Jeffrey Benkoe)