We know D.C. Get our free newsletter to stay in the know.

So D.C.’s rental market is sharply divided, with plenty of apartments for well-paid professionals without families but few for residents of more modest means. But what about its home sale market? Here, the answer’s a bit more complicated.

Home prices in the D.C. area have gone up across the board in the past five years, but according to an analysis by Redfin shared with Washington City Paper, the amount by which these prices have risen doesn’t fall into a neat pattern. Instead, two groups of homes have seen the biggest price increase: the cheapest ones and the most expensive ones.

The top fifth, or quintile, of homes in the D.C. region—-an area that includes 14 counties in Maryland and Virginia—-have sold for almost exactly 10 times the bottom quintile, in both June 2009 and June 2014. Over those five years, the homes in the top quintile saw a price increase of 56.7 percent, while those in the bottom quintile grew 55.4 percent more expensive. Homes in the middle experienced smaller gains, with the most modest change occurring in the fourth quintile, a rise of 27.3 percent.

Nela Richardson, Redfin’s chief economist, says the sharp gains in the first and fifth quintiles are taking place for different reasons. For the cheapest fifth of D.C.-area homes, the price spike has everything to do with the recession. “These are home that were hit hardest by the recession and now are rebounding,” Richardson says. “The farther you fall, the more ground you have to regain.” These homes also drew a lot of interest from investors, both personal and institutional, who saw the opportunity to snap up cheap housing at rock-bottom prices and have since refurbished and sold these properties for more money.

The increase in prices for the most expensive homes, on the other hand, follows a national trend in which high-end homes recovered most quickly from the recession. This pattern was most pronounced among the very priciest homes. “We’ve seen the top 1 percent of houses take off in both sales and prices,” says Richardson. “The rebound was the quickest. It was the first to recover.”

Perhaps starker than the difference in price increases among these different price levels is the difference in inventory. Very few of the cheapest homes in the D.C. area are actually on the market. The number of available homes in the bottom quintile has tanked since 2009, dropping 65.6 percent. Meanwhile, inventory in the top two quintiles has held fairly steady.

Back in 2009, the bottom two quintiles actually had the most inventory. Now the lowest quintile has the least. What happened in the interim? Two things, mainly, according to Richardson. First, the recession sapped low-income residents’ ability to trade up to a bigger or better home, so many of them found themselves unable to sell. That’s left few low-priced homes on the market. Second, investors have bought a lot of cheaper homes and converted them to rentals, often multi-unit rentals, thereby taking them off the market. Meanwhile, new construction has helped keep up the supply of upper-tier homes.

In the past two years, inventory in the D.C. area has begun to rebound. It’s climbed in each of the top four quintiles. But in the bottom quintile, it’s continued to decline, by a full 35 percent.

This is a troubling trend in isolation: It means that buying a home is growing harder for residents who can afford only the most modest houses and condos. But it’s even more problematic in the context of the rental market, where the stock of affordable apartments is vanishing. If lower-income residents can’t rent and can’t buy, their prospects in the District, and even in the broader D.C. area, are bleak.

First chart made with Chartbuilder; other charts from Redfin, with data from MLS