New house and apartment construction soared in December, ending a year to remember in Twin Cities residential real estate.

There was a 36-percent increase in single-family construction permits this month, with apartment developments experiencing a similar gain, Housing First Minnesota and the Builders Association of the Twin Cities reported Wednesday.

And for the full year, builders throughout the metro area pulled 6,113 permits to build 13,436 houses and rental units, the most since 2005, the trade groups said. Compared to last year, that represents a 14-percent increase in permits and a 36-percent increase in total units.

"Everyone was flat-out busy," said Bob Michels, president of Housing First Minnesota and a Twin Cities builder. "It felt like the good old days."

Demand for rentals has been stronger than for single-family houses for the eight years since the 2007-09 recession, but this year builders scrambled for both types of construction.

Through November, there were just under 5,000 sales of newly built homes in the metro, according to the Minneapolis Area Association of Realtors (MAAR). That was up 18.5 percent from the first 11 months of 2016. Those figures don't include new houses that were never listed through the Regional Multiple Listing Service.

For both apartments and houses, affordability is a growing concern as prices reached a new high in 2017. Increases are being driven by a combination of a shortage of housing and high construction costs.

As of November the median sale price of a new house in the Twin Cities was $329,000, or $174 per square foot, according to MAAR. That's compared with $238,000, or $142, for an existing one.

"Our industry is facing a serious labor shortage along with high regulatory costs. Both will continue to constrain the homebuilding industry and have an impact on housing affordability in 2018," said David Siegel, executive director of Housing First Minnesota.

Though the permit data is for the 13-county metro area, the bulk of that housing is being built in the cities and counties at the core. But there was more activity this year in outlying suburbs where land is more plentiful and less expensive.

In terms of total permits, Lakeville was the busiest city with 502. Plymouth was next with 380, followed by Blaine with 327. Lake Elmo issued the fourth most permits with 261. It was also the biggest gainer after issuing fewer than 30 permits in 2016.

"Excellent school districts are a major motivating factor for new home buyers in Lake­ville," said Todd Stutz, president of Robert Thomas Homes, a semi-custom builder.

Last year, the company sold 94 homes in Lakeville's Spirit of Brandtjen Farm, one of the most popular housing developments in the metro. Of his sales in that development, he said, house prices ranged from $400,000 to $1.1 million. Nearly 70 percent of those houses were to-be-built while about 30 percent were spec houses already in the company's inventory.

Stutz said his current sales backlog is already about 20 percent higher than at this time a year ago.

"We are cautiously optimistic about the new home market in 2018 based upon positive job growth, historically low mortgage rates and consumer confidence," Stutz said.

The local report mirrors a national trend. As of November, the latest data available, single-family permits reached a 10-year high, according to the U.S. Commerce Department.

In the coming year, the demand for single-family houses is expected to keep growing.

Nationwide, apartment construction is expected to show signs of easing as rising rents and vacancy rates stifle demand. That won't be the case in the Twin Cities, where the apartment construction market is forecast to reach new highs. About 5,000 new units are expected to hit the market, up from about 3,500 this year.

Multifamily projects represented 57 percent of all new home construction in the metro this year. Minneapolis was the busiest for apartment construction with 1,690 total units.