The U.S. economy grew faster than previously thought in the third quarter, helped by exports and government spending, but a sluggish global demand and belt-tightening by Washington looks set to put on the brakes again.

Other data on Thursday showed factory activity in the mid-Atlantic region picked up this month, while home resales in November were the best in three years, indicating the economy retained some vigor early in the fourth quarter.

However, a rise in first-time applications for unemployment aid last week suggested job growth remains modest.

Gross domestic product expanded at a 3.1 percent annual rate in the third quarter, the Commerce Department said. It was the fastest pace since late 2011 and more than double the second quarter's 1.3 percent rate.

A month ago, the department said GDP grew at 2.7 percent pace during the July-September period.

Millan Mulraine, a senior economist at TD Securities in New York, said the factors that boosted growth in the third quarter probably did not carry through the final three months of 2012.

"I don't think it changes the narrative that this quarter will be very weak. The fact that we had an upward revision means that it's a higher hurdle in the fourth quarter to get above the current best case of 1 percent (growth)," Mulraine said.

Economists say businesses have hunkered down in the current quarter out of worry that currently stalled budget talks in Washington will fail to steer clear of a $600 billion "fiscal cliff" that could tip the economy back into recession.

Even if a deal is reached to avoid the brunt of the blow, a tighter fiscal policy and cooling global economy are still likely to weigh on U.S. growth in coming quarters.

A Reuters poll of economists earlier this month showed a median forecast for GDP growth in the fourth quarter of just a 1.2 percent annual pace. Economists expect GDP to expand just 1.9 percent next year.

In a second report, the National Association of Realtors said sales of previously owned homes surged 5.9 percent in November to a seasonally adjusted annual rate of 5.04 million units. It was the fastest sales pace since November 2009 and confirmed a housing recovery was strengthening.

KB Home, the nation's fifth-largest homebuilder, reported a 20 percent rise in quarterly revenue in the latest quarter as selling prices rose, although higher costs still squeezed its margins.

Separately, a factory gauge from the Philadelphia Federal Reserve Bank showed activity in the mid-Atlantic region turned up this month after slipping in November, a finding that should ease fears of a hard landing for U.S. manufacturing.

"The sky is not falling on manufacturing," said Robert Dye, chief economist at Comerica in Dallas. "The contribution from housing-related manufacturing is making a difference."

MODEST JOB GROWTH

In a fourth report, the Labor Department said initial claims for jobless benefits increased 17,000 to a seasonally adjusted 361,000 last week, in the low end of the range they held before Superstorm Sandy struck in late October.

The data covered the survey period for the government's report on December nonfarm payrolls and suggested another month of modest employment growth. Job gains so far this year have averaged 151,000 per month, not enough to significantly lower unemployment.

U.S. stocks ended higher amid optimism over the budget talks in Washington. Prices for U.S. Treasury debt were flat, while the dollar was little changed against a basket of currencies.

In the third quarter, the economy was also buoyed by a big inventory buildup, which added 0.73 percentage point to GDP growth. Economists expect inventories to weigh in the fourth quarter.

"It could be that businesses will want to continue to accumulate inventories but that seems unlikely," said David Berson, chief economist at Nationwide Insurance in Columbus, Ohio. "It's the same with federal government spending, it's very unlikely to continue."

While growth in consumer spending, which accounts for about 70 percent of U.S. economic activity, was raised by 0.2 percentage point to a 1.6 percent rate, it was little changed from the second quarter's pace.

Exports grew at a healthy 1.9 percent rate, rather than the 1.1 percent reported a month ago, while imports fell for the first time in more than three years in a sign of sluggish domestic demand.

Government spending was revised to a 3.9 percent growth rate from 3.5 percent, with spending by state and local government growing for the first time in three years.

Taking out the boost from inventories and government, demand in the economy remained weak, rising at just a 1.5 percent rate - the slowest since the end of 2009 - and a step down from the 1.9 percent pace logged in the second quarter.

"It suggests that growth this quarter could be somewhere between 1.2 and 1.5 percent, if we don't have outsized contributions from government and inventories. That's very suboptimal growth," said Berson.

(Additional reporting by Jason Lange in Washington and Richard Leong in New York; editing by Andrea Ricci, Tim Ahmann and Leslie Gevirtz)