Containers being transferred at Qingdao Port on July 13, 2018 in Qingdao, Shandong Province of China.

China's exports growth unexpectedly accelerated in July despite fresh U.S. tariffs, though a still-wide trade surplus with the United States looks set to keep Beijing and Washington locked in a bitter dispute that has rattled financial markets.

Imports also rose much faster in July driven by still solid domestic demand, official data showed on Wednesday.

The headline numbers are the first readings of the overall trade picture for the world's second-largest economy since U.S. duties on $34 billion of Chinese imports came into effect on July 6.

China's closely watched surplus with the United States dipped only slightly to $28.09 billion last month from a record $28.97 billion in June. Washington has long criticized China's trade surplus with the United States and has demanded Beijing cut it. Still, disagreements between the two major economic powers run deeper than just the trade balance and tensions remain over market access, intellectual property, technology transfer and investment.

The United States and China implemented tariffs on $34 billion worth of each other's goods in July. Since then, Washington and Beijing have raised the stakes by threatening more punitive trade measures in an intensifying dispute that has rattled financial markets worried about the impact on investment and growth.

The two sides have shown no signs of letting up, with the U.S. earlier Wednesday saying it will begin collecting 25 percent tariffs on another $16 billion in Chinese goods on Aug. 23, and Chinese media resorting to personal attacks against Trump earlier in the week.

China's July exports rose 12.2 percent from a year earlier, beating forecasts for a 10 percent increase according to the latest Reuters poll, and up from a 11.2 percent gain in June.

A weaker yuan, which marked its worst 4-month fall on record between April and July, may have taken the sting out of 25 percent tariffs on $34 billion exports to the United States. However, analysts still expect a less favorable trade balance for China in coming months given it's early days in the tariff brawl.

After a strong start to the year, growth in the world's second-largest economy cooled slightly in the second quarter, partly hit by the government's years-long efforts to tackle debt risks.

The worry is that the escalating Sino-U.S. trade war, rising corporate bankruptcies, and a steep decline in the value of the yuan versus the dollar could put a significant dent on the economy.

The government has responded by releasing more liquidity into the banking system, encouraging lending and promising a more "active" fiscal policy.

Imports grew 27.3 percent in July, customs said, beating analysts' forecast of 16.2 percent growth, and compared with a 14.1 percent rise in June.