U.S. stocks ended a volatile trading day mostly flat on Thursday as investors were reluctant to make bets a day before a critical labor market report that could magnify fears the economy is slowing.

Early selling picked up after the S&P 500 broke through its May low of 1,311.08, though news of progress on a new debt plan for Greece sparked a rebound. Still, the three major U.S. stock indexes have been trending downward and investors worry about more losses if economic figures disappoint.

It would take a number way outside the expectation tomorrow to give us another negative shock, but because of the pervasiveness of weak data, investors will need to see a package of stronger data to move us up, and that's unlikely for at least a couple of months, said Christopher Sheldon, the Boston-based director of investment strategy at BNY Mellon Wealth Management, who helps oversee $166 billion.

Friday's non-farm payroll report is expected to show 150,000 jobs were added in May, according to a Thomson Reuters poll of economists. Wednesday's weak reading by ADP on private payroll growth prompted many economists to scale back forecasts, sparking the stock market's worst day in nearly a year.

Given recent losses, downside potential from current levels could be fairly modest, Sheldon said.

Another decline could open the window to a move back to the April low at 1,294, and the March lows near 1,250 to 1,260, the index's 200-day moving average.

Bank stocks stabilized after falling on news that Goldman Sachs Group Inc was subpoenaed by New York prosecutors seeking information on its role leading into the global financial crisis. Goldman's stock fell 1.3 percent to $134.38, while the KBW Banks Index <.BKX> rose 0.2 percent after falling earlier.

Education stocks rallied on heavy volume after U.S. officials relaxed rules that could have cut off tuition aid to programs run by for-profit colleges. DeVry Inc and Apollo Group Inc were the top two gainers in the S&P consumer discretionary sector. DeVry shot up 14.6 percent to $61.86, while Apollo surged 11.1 percent to $46.87.

The Dow Jones industrial average <.DJI> fell 41.59 points, or 0.34 percent, to 12,248.55. The Standard & Poor's 500 Index <.SPX> dipped 1.61 points, or 0.12 percent, to 1,312.94. The Nasdaq Composite Index <.IXIC> rose 4.12 points, or 0.15 percent, to close at 2,773.31.

Initial jobless claims slipped 6,000 to a seasonally adjusted 422,000 in the latest week, while economists polled by Reuters had forecast 415,000.

Since hiring growth seems to be minimal while gas prices remain high, investors are understandably concerned about momentum in the economy, which has weakened, said Tom Galvin, managing director and lead portfolio manager at Columbia Management in Stamford, Connecticut.

Moody's Investors Service said there was a small but rising risk of a short-lived default by the United States if the government's debt limit was not increased in coming weeks. Equities had little reaction to the news.

Retailers reported growth in May same-store sales, though the growth was less robust than expected. Gap Inc fell 4.1 percent to $18.12, while Costco Wholesale Corp lost 1.5 percent to $79.

Online coupon company Groupon Inc filed to raise up to $750 million in an initial public offering in the latest in a series of Internet companies to tap the U.S. capital markets.

About eight stocks fell for every seven that rose on the New York Stock Exchange while on the Nasdaq, the number of advancers and decliners was even. Volume was light, with about 7.2 billion shares traded on the New York Stock Exchange, the American Stock Exchange and the Nasdaq, below last year's daily average of 8.47 billion.

(Editing by Jan Paschal)