(Adds details, market reaction, analyst comments)
* Third-quarter GDP rises at a 3.5 percent rate
* Inventories, consumer spending boost growth
* Trade subtracts from growth; business spending stalls
WASHINGTON, Oct 26 (Reuters) - The U.S. 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 four years, keeping it on track to hit the Trump administration's 3 percent growth target this year.
Gross domestic product increased at a 3.5 percent annualized rate also supported by a surge in inventory investment and solid government spending, the Commerce Department said on Friday in its first estimate of third-quarter GDP growth. While that was a slowdown from a 4.2 percent pace in the second quarter, it still exceeded the economy's growth potential, which economists put at 2 percent.
Compared to the third quarter of 2017, the economy grew 3.0 percent, the best performance since the second quarter of 2015.
But business spending stalled and residential investment declined for a third straight quarter, potential red flags to the economic expansion that is now in its ninth year and the second longest on record.
Economists polled by Reuters had forecast GDP expanding at a 3.3 percent pace in the third quarter.
The 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 percent 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 U.S. 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 nonautomative capital goods. Strong domestic demand, however, sucked in imports of consumer goods and motor vehicles.
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 U.S. import duties, mostly on Chinese goods, came into effect late in the quarter. 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 percent rate in the third quarter compared to a 4.0 percent pace in April-June.
The dollar rose to a session high against a basket of currencies on the data while U.S. Treasury prices fell.
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 U.S. 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.
The GDP report showed the Fed's preferred inflation gauge, the personal consumption expenditures (PCE) price index excluding food and energy, increased at 1.6 percent rate in the third quarter. The core PCE price index rose at a 2.1 percent pace in the April-June period.
Growth in consumer spending, which accounts for more than two-thirds of U.S. economic activity, increased at a 4.0 percent rate in the third quarter. That was the fastest pace since the fourth quarter of 2014 and followed a 3.8 percent pace of increase in the second quarter.
Consumption is being supported in part by a tightening labor market, characterized by an unemployment rate that is at a near 49-year low of 3.7 percent.
But headwinds for the economy are growing. Business spending on equipment increased at a 0.4 percent rate, the slowest in two years, after rising at a 4.6 percent pace in the second quarter. Businesses are struggling to find workers and the import tariffs are increasing manufacturing costs for companies, such as Caterpillar Inc, 3M Co and Ford Motor Co.
Higher interest rates are pressuring the housing market, which contracted at its steepest pace in more than a year in the third quarter.
(Reporting by Lucia Mutikani Editing by Tomasz Janowski and Andrea Ricci)