Denver and Aurora have relied heavily on apartment construction to house their growing populations, but they have also seen a surge in single-family homes converted to rentals since 2007, according to a new study.

RentCafe, an apartment search engine, counted 27,300 new apartments and 11,000 new single-family home rentals in Denver between 2007 and 2016. That works out to a 37 percent increase in single-family homes for rent, primarily from conversions, and a 35 percent gain in apartments, primarily from new construction.

In Aurora, the number of apartments rose by 7,700, or 25 percent, while the number of single-family home rentals shot up by 4,500, or 38 percent.

That pattern in Aurora and Denver is playing out differently than the one seen nationally, where the stock of single-family rentals rose by 31 percent, or 3.6 million units, while the stock of apartments rose by 14 percent, or 3.2 million.

“The main trigger for this wave of single-family homes turning into rental homes was the housing crash of the late 2000s,” said the study’s author, Nadia Balint.

The crash reduced the share of people who owned and boosted the share who rented. In Denver, 47.1 percent of the population rented and 52.9 percent owned in 2016. In Aurora, 44 percent of the population rented, while 56 percent owned.

The crash also allowed investors, from large institutions to retirees looking for extra income, to snap up millions of homes at a discounted price. About 2 percent of the nation’s 15 million single-family rentals are in institutional hands, and 45 percent belong to landlords who own just one property, according to the Urban Institute.

With thousands of homes tied up as rentals, metro Denver has faced a chronic shortage of homes for sale. Housing experts are watching to see how landlords respond once home price gains start topping out or reversing. Will those homes come back on the market?

Nearly 40 percent of the 268,000 apartments in the larger metro area at the end of 2016 were located in Denver city limits. About 41,000 of the nearly 122,000 single-family homes and condos that were for rent in the metro area were located in Denver, the study found.

Despite improving consumer confidence, a survey from Freddie Mac found that about two-thirds of renters viewed leasing as a more affordable option than owning and a similar percentage plan to continue renting for that reason. That would point to a long-term shift in favor of renting.