Minnesota’s economy grew faster in 2012 than it has in nearly a decade, spurred by broad gains in manufacturing, wholesale trade, finance and insurance, and real estate rental and leasing.

The state’s gross domestic product surged 3.5 percent over the previous year, the fifth-fastest pace in the nation and Minnesota’s best year since 2004, according to figures released Thursday by the U.S. Department of Commerce.

“We are in an economic expansion here,” said Toby Madden, an economist at the Federal Reserve Bank of Minneapolis. “The Minnesota economy is doing pretty well.”

The Commerce Department reported that real GDP, the total value of goods and services adjusted for inflation, grew in every state last year except for Connecticut. North Dakota led the nation in growth, as the state’s oil boom continues to transform its economy.

Despite headwinds from a struggling European economy and cuts in government spending, the average growth rate for the states was 2.5 percent, nearly a full percentage point better than 2011.

Minnesota is doing better than any other state in the Midwest, with the exception of oil-rich North Dakota, where 2012 growth was an astonishing 13.4 percent. Texas, Oregon and Washington rounded out the top five nationally.

In Minnesota, the growth was reflected in employment. The state added more than 50,000 jobs last year, and unemployment ticked downward from 5.8 percent at the end of 2011 to 5.4 percent at the end of 2012.

“If the economy’s growing above 3 percent, you’re going to see reductions in unemployment,” said Pete Ferderer, an economics professor at Macalester College in St. Paul.

In the Midwest, North Dakota, Minnesota and Indiana all posted 2012 GDP growth above 3 percent. The rest of the region was more sluggish, with Wisconsin growing at 1.45 percent and South Dakota barely breaking even at 0.24 percent.

Per capita GDP in Minnesota is a little over $47,000, growing by 2.9 percent in 2012. That’s faster than all other states in the Midwest except North Dakota and Indiana.

Minnesota’s growth was spread across the economy, including agriculture, finance and insurance, wholesale trade, and the rental and leasing businesses, which all posted gains above 6 percent.

“The Twin Cities had one of the tightest rental availabilities in the nation,” said Madden, the Fed economist.

Thanks to a drought that struck hardest in states like Iowa and Illinois but largely spared Minnesota, the state’s corn, soybean and other crop farmers had high yields in a year of high grain prices. Median farm income rose 72 percent from 2011, to $254,800.

The strength of durable goods manufacturing in Minnesota and across the nation is a solid sign of an improving economy, Ferderer said.

“Durable goods are something that can be delayed in purchase, so when they’re growing rapidly, I take it as a sign that credit conditions are loosening up, and also, more generally confidence,” Ferderer said. “This is a good sign in terms of a rebound.”

State-specific GDP data is not available for the first quarter of the year, but national growth was 2.4 percent. The economy has been getting a boost from the Federal Reserve, which is holding down interest rates and driving down long-term rates by buying $85 billion in mortgage-backed securities per month.

“The Fed has had the pedal to the metal for four or five years now,” Ferderer said. “I guess at some point it’s got to have an effect.”

As the economy improves, the likelihood increases that the Fed might taper its unprecedented asset-purchasing program — known as quantitative easing. So, for now, good economic news helps fuel fears that the program will stop, causing mortgage rates to rise in the past month and roiling the stock market.