The US economy slowed less than expected in the third quarter as a tariff-related drop in soybean exports was partially offset by the strongest consumer spending in nearly a four years and a surge in inventory investment. 

US gross domestic product increased at a 3.5% annualised rate also supported by solid government spending, the Commerce Department said.

This was the Department's first estimate of third-quarter GDP growth. 

While that was a slowdown from a 4.2% pace in the second quarter, it still exceeded the economy's growth potential, which economists put at 2%. 

Compared to the third quarter of 2017, the economy grew 3%, the best performance since the second quarter of 2015, keeping it on track to hit the Trump administration's 3% growth target this year. 

The economic expansion, now in its ninth year, is the second longest on record. 

Economists polled by Reuters had forecast GDP expanding at a 3.3% pace in the third quarter. 

The US economy is underpinned by a $1.5 trillion tax cut and increased government spending. 

The fiscal stimulus is part of measures adopted by President Donald Trump's administration to boost annual growth to 3% on a sustainable basis. 

Yet the government is also locked in a bitter trade war with China as well as trade disputes with other trade partners and the last quarter's slowdown mostly reflected the impact of Beijing's retaliatory tariffs on US exports, including soybeans. 

Farmers front-loaded shipments to China before the tariffs took effect in early July, boosting second-quarter growth. 

Since then, soybean exports have declined every month, increasing the trade deficit. 

There were also decreases in exports of petroleum and non-automative capital goods. 

Strong domestic demand, however, sucked in imports of consumer goods and cars.

The widening trade gap chopped off 1.78 percentage points from GDP growth in the third quarter. That was the most since the second quarter of 1985 and reversed the 1.22 percentage point contribution in the April-June period. 

Some of the rebound in imports reflected a rush by businesses to stockpile before US import duties, mostly on Chinese goods, came into effect. Imports are a drag on GDP growth. 

But some of the imports likely ended up in warehouses, adding to the stockpile of inventory, which adds to GDP.

Inventories increased at a $76.3 billion rate after declining at a $36.8 billion pace in the second quarter. 

As a result, inventory investment added 2.07 percentage points to GDP growth, the biggest contribution since the first quarter of 2015, after slicing off 1.1 percentage points from output in the second quarter.

Excluding the effects of trade and inventories, GDP grew at a 3.1% rate in the third quarter compared to a 4% pace in April-June.

Solid third-quarter growth is expected to keep the Federal Reserve on course to raise interest rates again in December, despite a recent tightening in financial market conditions brought about by a stock market sell-off and a rise in US Treasury yields. 

The Fed raised rates in September for the third time this year and removed a reference to monetary policy remaining "accommodative" from its policy statement. 

Growth in consumer spending, which accounts for more than two-thirds of US economic activity, increased at a 4% rate in the third quarter. 

That was the fastest pace since the fourth quarter of 2014 and followed a 3.8% pace of increase in the second quarter. 

US consumption is being supported in part by a tightening labour market, characterised by an unemployment rate that is at a near 49-year low of 3.7%. 

But business spending on equipment stalled in the third quarter and residential investment contracted for the third quarter in a row, adding to growing headwinds for the economy. 

Higher interest rates are pressuring the housing market, businesses are struggling to find workers and the import tariffs are increasing manufacturing costs for companies, such as Caterpillar, 3M and Ford.