WASHINGTON — Spending on U.S. construction projects edged up 0.4 percent in May, while April's figure was revised down significantly — signs that new building is still uneven despite a growing economy.

The uptick in May brought total construction spending to a seasonally adjusted all-time high of $1.31 trillion, 4.5 percent higher than a year ago, the Commerce Departments said Monday. April's figure was revised down to 0.9 percent from what was originally reported as 1.8 percent gain, which would have been the largest increase in 24 years. That came on the heels of 0.9 percent drop in March, the first monthly drop since July of 2017.

Total private construction rose 0.3 percent, with residential projects up 0.8 percent in May. New single-family home construction rose 0.6 percent and the volatile apartment building sector jumped 1.6 percent. Private, non-residential building fell 0.3 percent.

Economists are forecasting that construction spending will contribute to overall growth this year even though interest rates are rising. A lack of inventory has stymied homebuyers and pushed home prices higher as demand for existing and new homes has surged.

Last month the Commerce Department reported that housing starts rose to a seasonally adjusted annual rate of 1.35 million, the strongest pace since July 2007, thanks to a surge of building in the Midwest.

Even as government budgets have tightened, construction of public projects in May rose 0.7 percent to $304.1 billion, the highest since October 2010. That gain was fueled by a 0.6 percent rise in state and local construction, which accounts for more than 90 percent of total government activity. State and local government construction spending was $282.1 billion, the most since September of 2009.

Spending on the power grid increased nearly 11 percent on a monthly basis, and is up more than 25 percent over a year ago.