China's factory sector contracted for the first time in a year in July and at its fastest pace since March 2009, a purchasing managers' survey showed on Thursday, as monetary policy tightening and slack global demand weighed on the economy.

Factory prices staged a rebound in July, underscoring the uphill battle facing the government as it tries to wrestle with inflation, which is running at a three-year high.

The vast manufacturing sector, accounting for about 40 percent of GDP, has led a slowdown in China's economic growth. But few analysts expect the economy to slump when it is underpinned by rapid urbanization and strengthening consumption.

The International Monetary Fund, in its annual report on China which was released on Thursday, said the economy was doing quite well and there was room to tighten monetary policy further.

Still, the latest sign of a slowdown in the economy could stir up some concerns among global investors, who are already worried by the risk of Europe's sovereign debt crisis and weakening growth in the United States.

With the central bank flagging no sign of an end to policy tightening, economic growth will continue to lose steam in the second half. But we don't see any risks of a hard landing and the slowdown is in the comfort zone, said Wang Jin, an analyst at Guotai Junan Securities in Shanghai.

The HSBC flash purchasing managers' index (PMI), the earliest available indicator of China's industrial activity, fell to 48.9 in July, a 28-month low. The index was last below 50 in July 2010.

That compares with the final reading of 50.1 in the HSBC PMI for June. The 50-point level demarcates expansion from contraction, with a reading above 50 indicating growth.

We expect industrial growth to decelerate in the coming months as tightening measures continue to filter through, said Qu Hongbin, the chief China economist at HSBC.

That said, resilience of consumer spending and continued investment in a massive amount of infrastructure projects should support a nearly 9 percent rate of gross domestic product growth in the rest of the year, he said.

China's industrial output rose 15.1 percent in June from a year earlier, accelerating from 13.3 percent in May, official data showed.

Economic expansion slowed to 9.5 percent in the second quarter from 9.7 percent in the first quarter. The economy is expected to retain much of its momentum in the coming quarters despite policy tightening, the latest Reuters poll shows.

PRICE PRESSURES

A sub-index of factory input prices in the flash data rebounded to 54.5 in July from a final reading of 51.9 in June. The sub-index for new orders dipped below 50 to its lowest in 12 months, reflecting weaker global demand.

Many analysts believe that inflation peaked in June at 6.4 percent or is close to peaking.

While food costs, a key driver of inflation so far this year, could lose steam in the second half, non-food inflation is picking up due to rising wages and utility costs.

That said, food prices remain elevated. Price pressures on pork, a popular meat in Chinese meals, should make the People's Bank of China extremely wary of even hinting it is done with tightening policy, lest that feeds into wider inflationary pressures.

Pork prices surged 57.1 percent in June from a year ago, contributing 1.4 percentage points to June's inflation.

While economists reckon inflation has peaked, they also think the pace of disinflation in the second half of the year will be painfully slow, keeping consumer inflation elevated near 5 percent and above the government's target of 4 percent.

Inflation is likely to have peaked. Provided there are no big surprises in food prices, it should peter out from here until year end, economists at HSBC said in a note. But the subsequent slowdown is likely to be very gradual through the third quarter. In other words, price stability will continue to top Beijing's agenda.

The People's Bank of China, keen to put a lid on price rises, has lifted the reserve requirement ratio for banks nine times and raised interest rates five times since October.

Many analysts expect the central bank to lean more on interest rates to fight inflation in coming months, partly because they see limited room for higher bank reserve ratios, which for big banks stand at a record 21.5 percent.

A Reuters poll published on July 7 showed a small majority of analysts expected at least one more rate rise this year.

(Additional reporting Aileen Wang; Editing by Ken Wills)