By Aileen Wang and Kevin Yao
BEIJING (Reuters) - China's economy slowed less sharply than expected in the second quarter and Beijing said corralling inflation remained its top priority even though a "complex and volatile" global economy clouded the outlook.
Second-quarter gross domestic product rose 9.5 percent from a year earlier, China reported on Wednesday, exceeding economists' forecasts for 9.4 percent growth. But that was still the slowest pace since the third quarter of 2009, when the world economy was pulling out of its worst recession in 80 years.
Some cooling was expected -- and even welcome -- because China has raised interest rates and clamped down on bank lending terms to try to ease inflation, which hit a three-year high in June. The stronger-than-expected GDP figures suggest Beijing may have more room to tighten without choking off growth.
"These are very good numbers," said Liu Li-Gang, an economist with ANZ in Hong Kong. "This is perhaps the reason the (central bank) raised interest rates last week. They are showing they are not afraid of a significant slowdown in the economy."
For investors worried that Beijing's tightening campaign might exact too heavy a toll on the economy, the figures offered some reassurance. Asian stocks, metals and the Australian dollar all rose.
Sheng Laiyun, a spokesperson for China's statistics bureau, said stabilizing inflation was the primary goal, and policies would be "targeted, flexible and effective."
"It's not easy and China has done a great job to maintain fast economic growth when the global situation is complex and volatile," Sheng said.
Europe's sovereign debt troubles and a slowdown in the U.S. economy means two of China's best export customers are struggling. New export orders slipped in June, a manufacturing survey showed earlier in July, which raised questions about China's growth prospects.
But Wednesday's figures suggested domestic demand remains robust. Final consumption contributed 4.6 percentage points to first-half growth, while exports subtracted slightly, China's statistics bureau said.
Industrial output growth rose 15.1 percent in June from a year earlier, quickening sharply from May's 13.3 percent and beating market expectations of 13.1 percent.
The growth figures underlined the resilience of the world's second-largest economy, thanks to the country's rapid urbanization, and could soothe investor concerns about a hard landing that would dent demand for global commodities.
Fixed-asset investment grew 25.6 percent in the first six months from a year earlier, while retail sales expanded 16.8 percent, showing that domestic demand still held up relatively well despite policy tightening.
"The economic growth data are quite upbeat and industrial production is noticeably stronger than expected," said Xu Biao, an economist with China Merchants Bank in Shenzhen. "It's quite beyond expectations as Chinese imports and (purchasing manager's survey) in June were quite weak."
Stronger demand at home not only helps insulate China from the global turmoil, it provides a bit of a buffer for the rest of the world and evidence that Beijing is making good on pledges to move away from export-driven growth. But it can also increase price pressures.
Fighting inflation remains Beijing's top priority but any policy steps should avoid causing big swings in economic growth, Chinese Premier Wen Jiabao said in comments published on Tuesday.
Last Wednesday, China raised rates by 25 basis points -- the third such increase this year -- which took the one-year bank deposit rate to 3.5 percent.
The central bank has raised benchmark interest rates five times since October and lifted banks' reserve requirement ratio -- its preferred policy tool so far -- nine times.
(Reporting by Aileen Wang and Kevin Yao and Zhou Xin; Writing by Emily Kaiser; Editing by Neil Fullick)