Factory activity in the U.S. Mid-Atlantic contracted in June to a near two-year low, overshadowing better than expected readings on the nation's labor and housing markets.

While the mixed reports on Thursday were the latest confirmation the economy continued to sputter in the second quarter, they also offered evidence that the recovery was on course to regain momentum as the year progresses.

We are still in a soft patch, first evident in the first quarter, and now we are seeing more and more evidence that it extended into the second quarter, said Robert Dye, a senior economist at PNC Financial Services in Pittsburgh.

But at the same time we are also seeing the first glimmers of evidence that the economy will find terra firma in the second half of the year.

The Philadelphia Federal Reserve Bank's business activity index, which measures Mid-Atlantic factory activity, dropped to -7.7, the lowest level since July 2009. It was the first contraction in nine months and suggested national factory activity could be faltering.

Economists had expected the gauge to rise to a positive 6.8. None of the 55 participants in a Reuters poll had expected a reading lower than zero, which indicates a contraction.

Other data showed first-time applications for state unemployment insurance fell 16,000 to 414,000, hinting at some improvement in a jobs market that stumbled badly in May.

A third report showed groundbreaking for homes rose 3.5 percent to an annual rate of 560,000 units last month, retracing almost half of April's steep decline. New building permits unexpectedly rebounded 8.7 percent to the highest level since December.

Coming on the heels of a survey on Wednesday showing a drop in factory activity in New York state, the Philadelphia Fed report fueled fears of a sharp slowdown in manufacturing, a sector that has powered the U.S. economic recovery.

Factory activity is being hampered by supply chain disruptions, particularly in the auto sector, following the March earthquake and tsunami in Japan. But the Philadelphia Fed and New York Fed surveys, where auto assemblies are not be a big factor, suggested fundamental weakness.

MANUFACTURING SLOWING

Economists said there was a risk that the Institute for Supply Management's index of national factory activity could contract in June after 22 months of expansion. The survey is scheduled for release on July 1.

In the Philadelphia survey, the six-month business conditions index hit its lowest level since December 2008 and the new orders measure tumbled to a two-year low.

There is no way to separate the effect of slowing auto production from a general manufacturing slowdown in these data, said Christopher Low, chief economist at FTN Financial in New York.

But a decline in the six-month forward activity index suggests there is more to the slowdown in Philly area manufacturing than just a temporary parts shortage.

Stocks on Wall Street ended mostly up, but gains were capped by fears that Greece could default on its debt.

Prices for U.S. Treasury debt rose, with benchmark yields falling to their lowest level this year. The dollar slipped against a basket of currencies.

MODEST IMPROVEMENTS

Despite the modest improvements in jobless claims and housing data, they remained at levels consistent with a muted economic recovery.

Initial jobless claims held above the 400,000 level for a tenth straight week. Economists associate claims below that level with a stable labor market.

While both housing starts and permits rose last month, they are still weak with builders facing stiff competition from a glut of unsold previously owned homes on the market.

Economists expect housing prices to sink further this year and to rise only marginally in 2012, according to a Reuters poll.

Separately, data firm RealtyTrac reported that banks repossessed over 66,879 homes last month, down 4 percent from April.

(Additional reporting by Pedro Da Costa; Editing by Chizu Nomiyama)