The July gain reflected a 0.6 percent rise in housing construction with both single-family and apartment construction posting gains. In June, housing had fallen 0.9 percent.
Government projects fell 0.3 percent in July with state and local spending down 0.4 percent. That drop more than offset a 1.1 percent rise in the smaller federal category.
The advance in housing activity pushed residential construction to its highest level since September 2008. The increase for nonresidential building was led by a 6.1 percent increase in construction of hotels and motels. Office building and the category that covers shopping centers also showed gains.
Total construction is 5.2 percent higher than it was a year ago with residential activity up 17.2 percent and nonresidential construction up by a more modest 2 percent. Public construction is down 3.7 percent from a year ago as all levels of government are still facing tight budget constraints.
The housing rebound that began in 2012 has helped drive economic growth and create jobs in the construction industry. But mortgage rates have climbed more than a full percentage point since May.
Although rates remain low by historical standards, the increase in rates has slowed the momentum in housing and has heightened concerns about what might happen going forward. Sales of new homes dropped 13.4 percent in July although sales activity remains 7 percent higher than 12 months ago.
Economists at JPMorgan expect that housing will keep improving with construction this year hitting 925,000 homes and apartments, up 18 percent from 2012. The forecast is for a further increase to a level of 1.13 million homes and apartments in 2014.
The overall economy grew at an annual rate of 2.5 percent in the April-June quarter, an improvement from a growth rate of 1.1 percent in the first three months of the year.
Federal Reserve Chairman Ben Bernanke has said the central bank is prepared to start reducing its monthly bond buying later this year if the economy and labor market keep improving.
Some economists believe the first cut in the $85 billion per month in bond purchases might come at the Fed's next meeting on Sept. 17-18. But others argue that the economic outlook remains too uncertain at the moment to start reducing bond purchases. They are forecasting the Fed will wait until either its October or December meetings before making a move.