Spending on U.S. construction projects in January posted the biggest gain in nine months, as strength in nonresidential construction and government projects offset continued weakness in home construction.

The Commerce Department says that construction spending rose 1.3 percent in January following two months of declines. It was the biggest gain since spending was up 1.7 percent in April. Spending on residential projects fell 0.3 percent in January, the sixth consecutive monthly decline for a sector that was hurt last year by rising mortgage rates and higher home building costs.

Spending on nonresidential construction increased 0.8 percent in January with spending on office buildings, hotels and the category that covers shopping centers all showing gains.

Spending on government projects jumped 4.9 percent, the biggest increase since March 2004. The January strength reflected a 4.9 percent rise in spending on state and local building projects and a 4.2 percent rise in federal construction spending.

It pushed total public construction spending to a seasonally adjusted annual rate of $313.6 billion, the highest level since September 2010.

The 1.3 percent overall gain pushed total spending to a seasonally adjusted annual rate of $1.28 trillion.

The weakness in home construction in January reflected a 0.7 percent fall in spending on single-family homes which was partially offset by a 1.4 percent rise in the smaller apartment sector.

Home construction has been weak over the past year, falling at an annual rate of 3.5 percent in the fourth quarter. That helped lower overall growth in the fourth quarter to a rate of 2.6 percent.

Economists believe growth has slowed further to around 1.5 percent in the current quarter as the U.S. economy feels the effects of a global slowdown.