FILE- In this Jan. 30, 2018, file photo a rubber tire gantry moves into position to transfer shipping containers at the Georgia Ports Authority's Port of Savannah in Savannah, Ga. On Wednesday, Nov. 28, the Commerce Department issues the final estimate of how the U.S. economy performed in the July-September quarter. (AP Photo/Stephen B. Morton, File)

FILE- In this Jan. 30, 2018, file photo a rubber tire gantry moves into position to transfer shipping containers at the Georgia Ports Authority's Port of Savannah in Savannah, Ga. On Wednesday, Nov. 28, the Commerce Department issues the final estimate of how the U.S. economy performed in the July-September quarter. (AP Photo/Stephen B. Morton, File)

WASHINGTON (AP) — The U.S. economy expanded at a solid 3.5 percent annual rate in the July-September quarter, led by lower but still strong consumer spending and more business investment than previously estimated.

The Commerce Department’s figure for gross domestic product, released Wednesday, was the same as its first estimate last month. GDP is the broadest measure of the nation’s output of goods and services and covers everything from homebuilding to haircuts. Greater corporate investment offset downward revisions in spending by state and local governments and consumers.

ADVERTISEMENT

The third quarter figure follows a robust expansion of 4.2 percent in the April-June quarter. Six months of healthy growth have put the U.S. economy on track to expand in 2018 at its fastest pace in 13 years. Still, economists forecast that growth will slow in the fourth quarter and decelerate further next year.

Borrowing costs are headed higher as the Federal Reserve raises short-term interest rates. That has lifted mortgage rates and weighed on home and auto sales. The Trump administration’s trade fights have also raised uncertainty for many companies and may cause them to delay investments. And the boost to consumer spending from last year’s tax cuts is likely to fade by next year.

The Trump administration has imposed tariffs on about half the goods that the United States imports from China, and has threatened to impose tariffs on the rest. That would raise prices on billions of dollars of consumer goods, including smartphones, tablets, toys and shoes.

“A trade war remains the biggest downside risk to near-term growth,” said Gus Faucher, chief economist at PNC.

Economists at JPMorgan Chase forecast that growth will slow to 2.5 percent in the fourth quarter and 2.2 percent in the first three months of 2019.

Even so, growth is on pace to top 3 percent this year for the first time since 2005. Consumer confidence is near 18-year highs, and the unemployment rate is at a nearly five-decade low of 3.7 percent.

Consumers lifted their spending 3.6 percent at an annual rate in the third quarter, a solid pace but down from the government’s first estimate of 4 percent. State and local governments spent just 2 percent, down from the previous estimate of 3.2 percent.

Those declines were offset by greater business investment: Companies spent more on equipment and did not cut back nearly as much on their spending on buildings as initially estimated. Businesses also spent more to stockpile goods on store shelves and in warehouses.

ADVERTISEMENT

The inventory building occurred as businesses stepped up their efforts to import more goods before January, when U.S. tariffs on $200 billion of imports from China are expected to jump to 25 percent, from 10 percent.

Imports surged 9.2 percent in the third quarter as companies sought to get ahead of the increased tariffs. Trump has also threatened to slap import taxes on car.

Exports fell 4.4 percent as more U.S. goods are facing retaliatory tariffs abroad. Exports of U.S. soybeans had jumped in the second quarter in advance of a large tariff increase imposed by China, a key market for U.S. soybeans. Those exports fell back in the third quarter.

The drop in exports and increase in imports in the third quarter meant that international trade cut into growth by the most since 1985.