Stocks rallied on Thursday, with the Nasdaq up for an eighth straight day, as strong labor market and retail sales data lifted optimism a day before the U.S. employment report for June.

Data from payrolls processor ADP showing U.S. private hiring increased by more than double expectations, coupled with a fall in new claims for jobless benefits, raised hopes that a recent slowdown in the economy may only be temporary.

The reports also fueled speculation that Friday's non-farm payrolls report from the Labor Department would provide more evidence of an improving labor market, a key factor if markets are to rally into the end of the year.

We went through a multi-month period of disappointing data, and now it is coming in better than anticipated, and that reset of expectations is providing a nice tail wind to markets, said Gary Flam, portfolio manager at Bel Air Investment Advisors in Los Angeles.

The Dow Jones industrial average <.DJI> was up 103.31 points, or 0.82 percent, at 12,729.33. The Standard & Poor's 500 Index <.SPX> was up 14.42 points, or 1.08 percent, at 1,353.64. The Nasdaq Composite Index <.IXIC> was up 40.18 points, or 1.42 percent, at 2,874.20.

However, Flam said a pullback was possible as the market digested recent gains. Both the Dow and S&P are up 6.7 percent since June 24, while the Nasdaq is up 8.4 percent in an uninterrupted rally.

The S&P 500 is likely to run into strong resistance around current levels, according to technical analysts at UBS.

Failure to break out above major supply will promptly lead to a near-term trading range between 1,258-1,263 and 1,340-1,345, the analysts wrote in a research note.

Retailers were among the best performers after several top companies reported better-than-expected sales gains for June, using bargains to lure shoppers in an uncertain economy.

Target Corp jumped 6.3 percent to $51.52 while Macy's Inc added 4.5 percent to $30.18 and Gap Inc was up 5.1 percent to $19.26. The S&P retail index <.RLX> gained 2.6 percent.

Employers are expected to have created 90,000 jobs in June, according to a poll of economists by Reuters.

The ADP report showed the private sector added 157,000 jobs last month, exceeding expectations for a gain of 68,000.

Major brokerages raised their price targets on Visa Inc a day after the world's largest card processing network said the impact from the Federal Reserve's new debit fee rule was manageable. Visa's stock rose 1.7 percent to $89.66.

Capital One Financial Corp gained 2.7 percent to $54.58 and was one of the top boosts on the S&P financial index <.GSPF> after KBW upgraded the stock to outperform. Bank of America Corp rose 1.8 percent to 410.93 and was the most actively traded stock on the New York Stock Exchange while the financial index rose 1.7 percent.

There were some glimmers of a potential compromise that would avoid a debt default as President Barack Obama and top congressional leaders searched for ways to break a deadlock over spending and taxes.

However, a small team of U.S. Treasury officials is discussing options to stave off default if Congress fails to raise the country's borrowing limit by an August 2 deadline, sources familiar with the matter said on Wednesday.

(Editing by Kenneth Barry)