In this Wed. Dec. 5, 2012, photo, containers are unloaded from cargo ships at  the Port of Los Angeles.  The U.S. economy unexpectedly shrank from October
In this Wed. Dec. 5, 2012, photo, containers are unloaded from cargo ships at the Port of Los Angeles. The U.S. economy unexpectedly shrank from October through December, the first quarterly drop since 2009 and a reminder of the economy's vulnerability as automatic cuts in government spending loom. ((AP Photo/Nick Ut))

The nation's economy suffered an unexpected downturn in the final months of 2012, the Commerce Department reported Wednesday.

In the first quarterly decline in 3 1/2 years, the economy shrank at an annual rate of 0.1 percent in the fourth quarter. Growth was hobbled by reduced defense spending, uncertainty over the fiscal cliff and businesses restocking their inventories at a slower rate.

The decline comes in stark contrast to the previous quarter's annual growth spurt of 3.1 percent. But Christopher Thornberg, a founding partner with Beacon Economics in Los Angeles, said things are far better than the drop in GDP might indicate.

"When you look at a 0.1 percent decline ... it's not a real number," he said. "You have to look at consumer spending which was actually up nicely, and business spending was also up. Real estate and construction - all of those numbers were solid. It's a clear indication that the economy was actually doing pretty well in the fourth quarter."

Consumer spending added 1.5 percentage points to GDP, the Commerce Department said, and business investment added 1.1 points - both stronger contributions than in the third quarter.

The three yearly GDP estimates measure the nation's total output of goods and services. They are revised by an average of 1.3 percentage points between the first and third estimate. That means the final figure for the fourth quarter could end up showing either growth or a steeper contraction.

Prestige Construction & Design, a Woodland Hills company that does residential and commercial remodeling, managed to hold its own and then some in late 2012.

"Actually, we had a pretty strong fourth quarter," owner Tom Maman said. "It's good marketing. We're just growing, and our natural growth gave us some good results in the fourth quarter."

Prestige may have done well but some of its competitors were struggling, according to Maman.

"I know a lot of other construction companies that were having a tough fourth quarter," he said. "Usually people are more focused on the holidays than on doing remodels."

Business was also solid at Shutts Fabricators in Long Beach. The company designs, fabricates and installs everything from radar masts to fuel and water tanks.

"Our fourth quarter was a little bit higher because we had some decent jobs from the port," owner Judy Shutts said. "But now we're sucking big time. We've got a lot of bids out there but none have come in yet."

Shutts said inventories are never a problem at her business because the company only orders the materials it needs for current jobs.

"A few other fabricators around here have had to get second jobs doing welding at night," she said. "But 2012 was better for us than the past three years. We got some jobs that were bid higher."

The plunge in defense spending in the October-December quarter followed a jump in the third quarter. The fluctuation might have reflected higher-than-usual spending that occurred in the July-September period in anticipation of government spending cuts later in the year.

Superstorm Sandy likely also slowed the national economy's growth by closing factories, disrupting shipping and shutting down retail stores.

U.S. exports fell by the most in nearly four years, a result of Europe's recession and slower growth in China and some other large developing countries.

Anemic economic growth has also slowed hiring. The economy has added about 150,000 jobs a month, on average, for the past two years. That's barely enough to lower nation's the unemployment rate, which has been parked at 7.8 percent for two months.

Jobless rates held steady in California and Los Angeles County last month, at 9.8 percent and 10.2 percent, respectively. The Inland Empire's rate dropped to 10.9 percent, compared with 11.3 percent in November, according to the state Employment Development Department.

OpenX, a Pasadena-based provider of digital and mobile advertising technology, said its fourth-quarter results were robust.

"The fourth quarter for us is always the strongest quarter for online advertising," said Jason Fairchild, the company's chief revenue officer. "We're thrilled because we almost doubled our revenue and nearly doubled our work force to 260."

OpenX opened a Tokyo office last year and also acquired the technology company LiftDNA, which works to improve the performance of advertisers.

The company has also partnered with Samsung to power its new Samsung AdHub Market mobile exchange.

The Associated Press contributed to this report.

kevin.smith@sgvn.com

626-544-0810