BEIJING — China's rapid economic growth slowed in the latest quarter to a still robust 9.5 percent, easing fears of an abrupt slowdown and giving Beijing room to tighten controls to fight surging inflation.

Growth slowed from 9.7 percent in the January-March quarter following repeated interest rate hikes and other controls, data showed Wednesday. Factory output rebounded and retail sales grew by double digits.

While the United States and Europe try to shore up sluggish growth, Beijing wants to steer its breakneck expansion to a more manageable level and cool inflation that soared to a three-year high of 6.4 percent in June.

"The strength of the economy will make them confident and well prepared to impose more tightening measures if needed," said Frances Cheung, a senior strategist for Credit Agricole CIB in Hong Kong.

Many analysts had expected second-quarter growth of 9.3 percent to 9.5 percent. Asian stock markets, which have wilted in recent days amid Europe's worsening debt crisis, got a boost from the Chinese economy's resilience.

The slowdown in the world's second-largest economy could have global repercussions if it cuts into demand for iron ore, factory machinery and other imports. Data released earlier showed China's import growth fell sharply in June.

Inflation is politically dangerous for the communist government because it erodes the public's economic gains and can fuel unrest.

Analysts expect inflation to ease later in the year but June's unexpectedly sharp price rises, driven by a 14.4 percent jump in food costs, prompted suggestions Beijing might hike rates again or tighten other controls.

"Stabilizing prices remains the top priority for our macro-regulatory policies," Premier Wen Jiabao told a group of businesspeople on Tuesday, according to the official Xinhua News Agency. The report gave no indication of possible new control measures.

Analysts blame the inflation spike on the dual pressures of consumer demand that is outstripping food supplies and a bank lending boom they say Beijing allowed to run too long after it helped China ward off the 2008 global crisis.

June's food price increase was driven by a 57.1 percent jump in the price of pork, the country's staple meat. That can be especially volatile in a society where poor families spend up to half their incomes on food.

"Most common people cannot bear the burden," said Wang Shulan, a 55-year-old woman who was shopping at a Beijing market. "The price for pork has risen by so much."

Beijing's anti-inflation measures have prompted concern they might trigger an abrupt slowdown but most analysts say China can avoid that.

"Any slowdown is likely to be fairly gradual and China can manage a soft landing rather than a hard landing," said Credit Agricole CIB's Cheung.

Factory output rose 15.1 percent in June over a year earlier, the National Bureau of Statistics reported.

Growth in retail sales accelerated to 17.7 percent, up from the first quarter's 16.3 percent. That could be a positive sign for Beijing's efforts to boost domestic consumption and reduce reliance on exports and investment to drive growth.

Spending on factories, real estate and other fixed assets declined by 1.04 percent compared with May.

"Our forceful measures are showing results," said a statistics bureau spokesman, Sheng Laiyun, at a news conference.

The World Bank is forecasting China's economic growth this year at 9.3 percent after raising its outlook earlier this year from 8.5 percent.

"The biggest challenge for the second half is how to strike a balance between steady and fast growth, inflation expectations and economic readjustment," said Sheng, the government spokesman.

National Bureau of Statistics (in Chinese):