Even in the worst of times, Farmington was the little city that could.

It was the only south-of-the-river community remote from major freeways that never fell below 70 new housing units per year, no matter how bad the housing crash became.

Lee Smick, the city's top planner, is convinced that one reason is Farmington's willingness to zig while others zagged by creating compact, affordable lots.

"We right now have an opportunity for 5,000-square-foot lots," she said. "We have a whole development whose lots are only 34 feet wide."

With newly available full-year 2012 statistics now in hand -- a year that appears to mark at least the beginning of the end of the housing bust -- it is now possible to peer back at the bust years and compare.

Among the conclusions:

• Apart from Farmington, cities with fairly upscale demographics, quick freeway access, or both -- like Prior Lake, Savage and Lakeville -- were the most consistent performers.

• As the outer rings of suburbia age, and with senior housing moving to the fore, suburbs south of the river are starting to look statistically more and more like inner-ring suburbs -- meaning, they rely more on multifamily projects, so their unit counts jump wildly from year to year. One inner-ring suburb, St. Louis Park, ballooned from just five new units in 2011 to more than 500 in 2012.

• A number of communities are seeing steady year-to-year comebacks, even to the point of nearing or equaling pre-crash highs. Eagan, more or less fully built out, managed nearly as many units last year as in 2005 and more than 2006, although far fewer than in its heyday.

• Exurbs such as Belle Plaine remain in the doldrums, victims perhaps of a combination of volatile gas prices that make long commutes expensive and lower prices in communities closer in.

That's one thing that makes Farmington stand out, because it, too, is practically an exurb.

"It's not called 'Farming-to[w]n' for nothing," Smick said. "We have lots of acres still being farmed." But it's just a few minutes' drive from major job concentrations in Eagan -- a quicker commute than a lot of city dwellers can manage who work in the same town.

Farmington's housing market, some say, also didn't get as overheated as those in some communities during the pre-recession boom.

"It never had the big runup, so it didn't have as far to fall," said Steve Logan, who heads the Minnesota division of Mattamy Homes. He also said that homebuilding in Farmington has tended to be spread among a large number of companies, each working on a relatively small number of houses. That has kept the city on a fairly even keel.

Lakeville also emerges from the crash in a strong position, one of the metro area's leaders at a time when Shakopee, once a competitor for that distinction, has fallen far down the list. The city issued 279 single-family permits last year, up from 118 in 2011 and the highest total since 2004. Shakopee reported 90 residential units for 2012.

Homebuilders cite Lakeville's strong school system as an important reason for the city's relatively healthy housing market, as well as community amenities such as parks.

Another reason for the upturn, in Lakeville and Prior Lake for instance, was cheap land: subdivisions that had gone into foreclosure but were snapped up by other developers at fire sale prices.

In Lakeville, Lennar Homes bought and began building homes on an 81-acre subdivision that had gone back to the lender in 2008. Mike DeVoe, president of Ryland Homes, said his firm built 26 homes in Prior Lake last year on lots it bought from a bank that had taken them back from the original developer.

Charlie J. Pfeffer, a sales associate with Maple Grove brokerage firm Pfeffer Co., said another reason Lakeville has fared better than other cities is that it has typically offered homes in a wide variety of prices, spreading its risk and not depending too heavily on one segment of the market.

Lakeville has also seen some big multifamily projects, as have others. Senior housing accounted for much of the recent wave of multiunit housing in cities like Burnsville and Mendota Heights. And that will continue: a 332-unit upscale apartment project being planned for Apple Valley is aimed partly at empty-nesters.

David Peterson • 952-746-3285 Susan Feyder • 952-746-3282