The economy grew in the third quarter for the first time in a year as consumer spending and investment in new home-building rebounded, data showed on Thursday, unofficially ending the worst recession in 70 years.

The Commerce Department, in its first estimate of third-quarter gross domestic product, said the economy grew at a 3.5 percent annual rate, the fastest pace since the third quarter of 2007, after contracting 0.7 percent in the April-June period.

The growth pace in GDP, which measures total goods and services output within U.S. borders, was above market expectations for a 3.3 percent rate. The economy last grew in the second quarter of 2008.

Recessions in the United States are dated by the National Bureau of Economic Research and the private-sector group often takes months to make determinations. The economy slipped into recession at the end of 2007 and has been in the worst downturn since the Great Depression of the 1930s.

The third-quarter recovery was generally broad-based, with solid gains in consumer spending, exports and investment in home-construction.

Consumer spending, which accounts for over two-thirds of U.S. economic activity, surged at a 3.4 percent rate in the third quarter, the fastest advance since the first quarter of 2007. Spending fell at a 0.9 percent rate in the previous quarter.

Residential investment, which was the main force behind the downturn, jumped at a 23.4 percent rate in the third quarter, contributing to GDP for the first time since 2005, after declining 23.3 percent in the April-June period.

The surge in consumer spending and residential investment was likely driven by government stimulus programs.

The economic recovery in the third quarter was also supported by a sharp moderation n the pace of inventory liquidation by business. Business inventories fell $130.8 billion, slowing from a record $160.2 billion plunge in the second quarter. The change in inventories added 0.94 percentage points to real GDP in the third quarter.

Analysts are hoping that the slowdown in the inventory decline by businesses will continue to support the economy in the fourth quarter, even as consumer spending is expected to retreat under the weight of the worst labor market in 26 years.

Excluding inventories, GDP rose at a 2.5 percent rate compared to a 0.7 percent increase in the second quarter.

The weak dollar boosted exports, but a rise in imports subtracted from real GDP during the quarter. Federal government spending contributed to growth, but both state and local governments were a drag.

Business investment fell at 2.5 percent pace, with investment nonresidential structures dropping 9 percent, a reflection of ongoing problems in the commercial property market.

(Reporting by Lucia Mutikani; Editing by Neil Stempleman)