Stocks rose on Thursday as investors looked for value in the market after its recent sell-off, shrugging off weaker-than-expected regional factory data.

Energy shares helped lead gains, with the S&P 500 energy index <.GSPE> up 0.9 percent. The S&P energy index has fallen about 10 percent since the market's May 2 high, while the S&P 500 has dropped roughly 7 percent in that period.

When we started the week, the stock market was arguably undervalued and pessimism was widespread, said Hugh Johnson, chief investment officer of Hugh Johnson Advisors LLC in Albany, New York.

Stocks briefly turned lower for the day after data showed factory activity in the U.S. Mid-Atlantic region unexpectedly shrank in June, another sign of weakness in the manufacturing sector.

While the data shows a piece of the economic puzzle, investors are looking for further evidence of how much longer the economy's soft patch may continue, Johnson said. The key is June. Did we start to recover in June?

Another report on Thursday showed the number of Americans signing up for jobless benefits fell last week, while housing starts and building permits rose in May, For details, see [ID:nN16172420]

The Dow Jones industrial average <.DJI> was up 83.10 points, or 0.70 percent, at 11,980.37. The Standard & Poor's 500 Index <.SPX> was up 6.64 points, or 0.52 percent, at 1,272.06. The Nasdaq Composite Index <.IXIC> was up 6.65 points, or 0.25 percent, at 2,638.11.

Worries that the lack of a deal to resolve the Greek debt crisis could crimp market liquidity kept gains in check.

Among the day's upbeat company news, shares of Kroger Co , the biggest U.S. supermarket operator, jumped 4.8 percent to $24.06 after it posted a higher-than-expected quarterly profit that was helped by cost controls and a rise in sales. Kroger also boosted its full-year profit forecast.

Analysts are eyeing technical support for the S&P 500 at 1,256.81, its 200-day moving average, and at the 2011 low near 1,250.

(Reporting by Caroline Valetkevitch; Additional reporting by Rodrigo Campos; Editing by Jan Paschal )