Spending on U.S. construction projects was essentially unchanged in September, the weakest showing since June, as an increase in home construction was offset by a slide in spending on government projects.

The Commerce Department said Thursday that the flat reading for September followed a 0.8 percent rise in August.

The strength last month was driven by a 0.6 percent increase in residential construction and a smaller 0.1 percent increase in nonresidential activity, which pushed this category to an all-time high. However, these gains were offset by a 0.9 percent drop in spending on government projects.

The increase in residential construction featured an 8.7 percent jump in apartment construction, which offset a 0.8 percent drop in single-family homes.

Apartment construction can be volatile from month to month. Overall, the home sector has struggled for much of this year as builders have had to cope with rising costs for land, lumber and labor. Part of the increase in lumber prices stemmed from the higher tariffs the Trump administration has imposed on Canadian softwood lumber.

Residential construction has been a drag on the overall economy, falling every quarter this year. While business construction was strong in the first two quarters, it fell at a 7.9 percent rate in the July-September quarter. The decline was viewed as a potentially worrisome sign that the boost businesses received in bigger tax breaks for investment from the $1.5 trillion tax cut passed last December may be starting to wane.

While overall construction was flat last month on a percentage basis, it did climb enough to push total spending to a record annual rate of $1.33 trillion.

The 0.1 percent rise in private non-residential construction boosted that category to a record annual rate of $463.9 billion, thanks to gains in hotel construction and office building, which offset a drop in spending in the category that includes shopping centers.