BEIJING (AP) — China’s economic growth held steady in the quarter ending in March, buoyed by investment and rapid growth in e-commerce amid mounting trade tensions with Washington.

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.”

Forecasters are expecting growth to cool this year as Beijing tries to rein in rising debt by tightening controls to cool a boom in real estate sales and bank lending.

The ruling Communist Party is in the midst of a marathon effort to steer the country to slower, more sustainable growth based on domestic consumption and reduce reliance on trade and investment.

A potential looming threat is President Donald Trump’s threat to raise duties on up to billion of Chinese goods in a dispute over Beijing’s technology policy. Beijing has issued its own list of U.S. goods for possible retaliation.

The country’s trade balance swung to a rare deficit in March as exports contracted 2.7 percent. The country relies less on trade than it did a decade ago but export industries still support millions of jobs.

In a positive sign for efforts to encourage consumer spending, retail sales rose 9.8 percent, up from December’s 9.4 percent growth, according to the National Bureau of Statistics.

E-commerce sales surged 35.4 percent, up 3.3 percent from the previous quarter.

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

Factory output rose 6.8 percent over a year earlier.