China's economic growth held steady in the quarter ending in March amid a worsening trade dispute with U.S. President Donald Trump, buoyed by strong e-commerce and factory output.

The world's second-largest economy expanded by 6.8 percent over a year earlier, in line with the quarter ending in December and down slightly from 2017's full-year expansion of 6.9 percent, data showed Tuesday. It was above the official 2018 target of "around 6.5 percent," which would be among the world's strongest if achieved.

A government spokesman expressed confidence China's $12 trillion-a-year economy can withstand Trump's threatened tariff hikes on up to $150 billion of Chinese goods in a dispute over technology policy.

China has "room to maneuver" following efforts to develop more self-sustaining growth based on domestic consumption and reduce reliance on trade, said Xing Zhihong, spokesman for the National Bureau of Statistics.

"China is fully capable of responding to Sino-U.S. trade frictions, responding to challenges and maintaining sustained and healthy economic development," Xing said at a news conference.

Forecasters expect Chinese growth to cool this year as Beijing tries to rein in rising debt seen as the biggest threat to economic stability by tightening controls to cool a boom in real estate sales and bank lending.

Last year's expansion was unexpectedly strong but activity began to weaken in March.

"China's economy entered 2018 with solid growth momentum," Louis Kuijs of Oxford Economics said in a report. "But momentum slowed in March, compared to the first two months, pointing to slower growth ahead."

The statistics bureau said growth compared with the previous quarter, the standard used by other major economies, slowed to 1.4 percent from 1.6 percent in the final three months of 2017. Beijing has begun to report such quarter-on-quarter figures in recent years but its headline number is measured against a year earlier, which makes Chinese growth seem smoother than that of other economies.

Europe and other trading partners also complain China is flooding global markets with unfairly low-priced steel, aluminum and other goods, threatening jobs abroad.

"We worry about the long-term implications but view a trade war with substantial short-term growth impact as unlikely," Kuijs said.

Most Asian stock markets trade higher following China’s GDP reports
The gross domestic product of China, the world's second-largest economy, grew by 6.8 percent during the January-March quarter, compared to the same period in 2017. Reuters

The ruling Communist Party is trying to steer China to slower, more sustainable growth based on domestic consumption instead of trade and investment. But Beijing has repeatedly set that back by relying on infusions of bank lending to shore up the economy since the 2008 crisis, adding to rising debt.

In a positive sign for efforts to encourage consumer spending, retail sales rose 9.8 percent, accelerating from December's 9.4 percent growth, according to the statistics bureau. E-commerce sales surged 35.4 percent, up 3.3 percentage points from the previous quarter.

Factory output rose 6.8 percent over a year earlier.

"While we don't think China's economy is expanding as rapidly as the official figures claim, there is broader evidence to suggest that a recovery in industry did prevent growth from slipping too much last quarter," said Julian Evans-Pritchard of Capital Economics in a report.

Investment in factories, real estate and other fixed assets rose 7.5 percent, up from 2017's 7.2 percent growth.

"Outside of industry, activity looks to have cooled recently," Evans-Pritchard said. "Construction growth is slowing as local governments pare back infrastructure spending in order to control debt levels."

China's trade balance swung to a rare deficit in March as exports shrank 2.7 percent over a year earlier. Trade accounts for less of China's economic activity than in earlier years but still supports millions of jobs.

In a speech last week, President Xi Jinping promised to open China's markets wider, cut import duties on autos and ease restrictions on foreign ownership in the auto and finance industries. He gave no details and didn't directly address Trump's complaint that Beijing improperly pressures foreign companies to hand over technology.

The ruling party's annual development plan, announced last month, calls for further cuts in the bloated state-owned steel industry and a bigger role for market forces and entrepreneurs.