Construction spending rose for the second time in three months in June as residential building increased, fresh evidence that the housing sector may be recovering.

The Commerce Department said Monday that construction spending increased by a seasonally adjusted annual rate of 0.3 percent in June, defying analysts' estimates of a 0.5 percent drop. May construction spending was revised up slightly to a 0.8 percent decline.

Still, June's $965.7 billion in spending was 10.2 percent below the year-ago level.

The data follow earlier reports that new and existing home sales each rose in June, and new home construction also increased. Buyers were taking advantage of bargain prices, low interest rates and a federal tax credit for first-time homeowners. Some homebuilders' stocks have risen recently, but falling home prices are expected to limit their earnings.

Public construction also helped drive the increase, jumping 1 percent to $321.7 billion for the biggest rise since March, the department said.

Federal government construction spending increased 1.9 percent, the most since December 2008, after falling 0.3 percent in May and plummeting 6.1 percent in April. State and local construction rose 1 percent as spending on education and highway construction also grew.

"The government had its fingerprints all over the report," Jennifer Lee, an economist at BMO Capital Markets, wrote in a note to clients.

Private residential construction rose 0.5 percent to a seasonally adjusted annual rate of $246.1 billion. The improvement follows a 3.1 percent drop in May.

Construction spending was hammered by the housing and financial crises that plunged the economy into the longest recession since World War II.

Overall, the U.S. economy shrank at a 1 percent rate in the April-June quarter, the department said last week, a sharp improvement from the 6.4 percent contraction in the first quarter and a 5.4 percent decline in the fourth quarter of 2008. The gross domestic product, the broadest measure of the nation's output, has contracted for four consecutive quarters.

New U.S. home sales jumped 11 percent in June to a seasonally adjusted annual rate of 384,000, the strongest pace since November 2008. The last time sales rose that much was in December 2000.

Shares of big homebuilders, including Beazer Homes USA and Hovnanian Enterprises, have jumped in recent weeks. But with home prices falling, the big builders are not expected to make much money anytime soon.

The median sales price of $206,200, was 12 percent lower than a year earlier and down nearly 6 percent from $219,000 in May.