The Twin Cities economy grew at its fastest pace in nearly a decade last year, and real estate was the big driver.

The Commerce Department reported Tuesday that real GDP, the total value of goods and services adjusted for inflation, grew by 3.9 percent in Minneapolis-St. Paul, adding more than $7 billion in economic activity.

Almost a third of the growth was in real estate, rentals and leasing, thanks to an improved housing market and low rental vacancy.

“We have one of the lowest vacancy rates in the United States,” said Toby Madden, an economist at the Federal Reserve Bank of Minneapolis. “Home sales were up in August 2012 over August 2011 by 12 percent. Sale prices were up 16 percent.”

Minneapolis-St. Paul didn’t move from its spot as the 13th-largest metropolitan economy in the U.S., behind Seattle and ahead of Detroit. GDP grew in 305 of the nation’s 381 metropolitan areas.

But the pace of growth in the Twin Cities was well above the national average, better than major Midwestern cities like Chicago, Milwaukee, St. Louis and Kansas City, and propelled Minnesota into having the fifth-fastest growing economy in the nation.

Unemployment in the metro area was 4.9 percent in July, compared with a national average of 7.4 percent. With a population of 3.4 million, including 125,000 people across the river in Wisconsin, the Twin Cities metropolitan area accounts for three-fourths of Minnesota’s economic activity.

The metro area's economy is not without its problems. Minnesota -- and by extension the Twin Cities -- has a near-record number of job openings, and good jobs are available, but the median wage offer has fallen to $12.50 an hour and available jobs have increasingly been temporary. 

Still, whatever pain workers felt looking for good jobs in 2012 was not reflected in the GDP figures.

Banking, insurance and real estate grew the most as the metro area generated $220 billion in GDP in 2012 dollars. Gains by food companies, medical device firms, retail and construction illustrate the Twin Cities’ greatest strength -- economic diversity, said Michael Langley, president of Greater MSP, an economic development group.

“We’re not a one-horse town,” Langley said. “We have other major industry sectors that are also showing growth, including manufacturing of both durable and non-durable goods, but also business services and professional services around our headquarters here.”

In the rest of Minnesota, Mankato’s and St. Cloud’s economies grew slightly faster than the Twin Cities, and Rochester was not far behind.

Duluth-Superior's economy was one of the few nationally and the only in Minnesota that shrank. GDP there fell in 2012 by 2 percent, or about $167 million. The weakness came thanks to declines in mining output and financial services, according to the Commerce Department.

Here's how the Twin Cities stack up against the other big metro areas in the U.S.: