The U.S. unemployment rate fell in July for the first time in 15 months as employers cut far fewer jobs than expected, giving the clearest indication yet that the economy was turning around from a deep recession.

U.S. employers shed 247,000 jobs in July, the Labor Department said on Friday, the least in any month since last August, taking the unemployment rate down to 9.4 percent from June's 9.5 percent.

It suggests the recession will be ending before the end of the year. There isn't any part of the economy that hasn't shown some slowing in deterioration, said Joe Davis, chief economist at investment company Vanguard in Valley Forge, Pennsylvania.

Recent data ranging from home sales to manufacturing have pointed to an economy starting to dig itself out of one of the worst recessions since the Great Depression of the 1930s.

President Barack Obama, who has seen his standing in public opinion polls slip as Americans fret about the weak economy and high unemployment, said July's jobs report showed the worst may be behind us. But he cautioned there would be no true recovery as long as the economy continued to shed jobs.

U.S. stocks rallied on the data as investors took the view that the recession was ending. The Dow Jones industrial average ended up 1.2 percent at 9,370.07. The dollar surged, while government bond prices tumbled.

Analysts had expected nonfarm payrolls to fall by 320,000 in July and the jobless rate to hit 9.6 percent. The forecast was made earlier this week before other jobs data, including weekly jobless claims, prompted some analysts to lower their predictions for job losses.

The government revised data for May and June to show 43,000 fewer jobs were lost than previously reported.

Overall, we view it as a clear signal that the economy was emerging from the recession in July, said Dean Maki, a senior economist at Barclays Capital in New York.

The easing in the unemployment rate could have been the result of the labor force shrinking by 422,000 in July, far more than the 155,000 decline in June, suggesting some jobless workers may have given up looking for work.

In the United States, for the purpose of calculating the unemployment rate, the labor force is defined as those with a job plus those out of a job but actively looking for work.

The White House said it still expected the unemployment rate to hit 10 percent this year.

Still, the relatively small decline in July payrolls was a relief to investors after months of heavy losses.

Slowing job losses also could mean less pressure for a second government economic stimulus as a $787 billion package approved this year slowly works its way through the economy.

MOSTLY GOOD NEWS

While employers cut fewer jobs than forecast, unemployment remains stubbornly high, meaning households have less income to spend and little borrowing capacity. This could set the economy for an anemic recovery, analysts said.

Federal Reserve data on Friday showed consumer borrowing sank $10.3 billion in June after dropping $5.4 billion in May.

Since the start of the recession in December 2007, the U.S. economy has shed 6.7 million jobs, the Labor Department said, adding that 14.5 million people were unemployed in July. In that month, a record of about 5.0 million Americans had been without a job for more than six months.

However, in a sign that the labor market deterioration was slowing, a gauge of labor market slack that measures both the unemployed, people working part-time for economic reasons, and those only marginally attached to the labor force, fell to 16.3 percent in July from a record high 16.5 percent in June.

Job losses in July were spread across all sectors, but the pace of firings slowed markedly from previous months.

Manufacturing employment fell by 52,000 after shrinking by 131,000 in June. This was the first time since September that manufacturing job losses were less than 100,000 and was likely due to the reopening of General Motors and Chrysler assembly plants after the two automakers emerged from bankruptcy.

Payrolls in construction industries slipped 76,000 after falling 86,000 in June, probably reflecting spending on infrastructure projects from the stimulus package and a modest pickup in ground breaking for new homes.

In the services sector, 119,000 workers were laid off, and goods-producing industries lost 128,000 positions.

Education and health services continued to add jobs though, with payrolls increasing 17,000 in July after rising 37,000 in June. Government employment increased 7,000 after slipping 48,000 in June. Leisure and hospitality added 9,000 jobs.

The pace of decline is slowing, consistent with the view that output has hit bottom and growth is now resuming, said Nigel Gault, chief U.S. economist at IHS Global Insight in Lexington, Massachusetts. Today's report brought the light at the end of the tunnel a bit closer.

The average work week, considered a good leading indicator of an economic upturn, inched up to 33.1 hours in July from 33.0 in June. The average work week in the manufacturing sector rose to 39.8 hours from 39.5 in June, the department said.

Average hourly earnings rose three cents to $18.56.

(Additional reporting by Matt Spetalnick in Washington and Richard Leong in New York; Editing by James Dalgleish)