Bucking the more common seesaw pattern of recent years, home sales in August rose for the second month in a row, buoyed by a decline in mortgage interest rates. Both new and existing homes posted gains, reaffirming analysts’ indications that there is a high level of pent-up demand for homes, but that many prospective buyers have been deterred by tight inventories and high prices.

An unanticipated influx of more affordable properties gave existing home sales a lift in July. In August, falling mortgage rates kept the momentum going as sales rose an additional 1.3% for the month.

Sales levels had been lagging behind those of 2018 during the first half of the year but now are up 2.6% from the same period last year. Sales of single-family homes increased by 1.2% over July and by 2.9% compared to August 2018.

The biggest growth in August, however, was in new single-family home sales, which jumped 7.1% over upwardly revised sales figures for June and July, reaching their second highest level in over a decade.

That spike brought year-over-year sales to an 18% gain, making up for a slow start to the year. In addition, new single-family home starts grew 4.4% for the month, and permit requests were up 4.5%.

Real estate brokerage website Redfin reported that sales of all homes across the 217 metro areas it tracks leapt 4.9% compared to July, shooting up 10.8% compared to August 2018. It was the largest year-over-year sales increase since March 2017, according to Redfin’s data analysis. Redfin chief economist Daryl Fairweather said the gains were mainly attributable to declining inventory supply, causing buyers to take advantage of lower mortgage rates to snap up homes while they are still available.

One reason why new home sales performed so well appears to be that lower mortgage rates made new homes more affordable for more affluent buyers. The median sales price of a new single-family home increased by nearly $15,000, to $328,400, and the average price was up around $16,000, to $404,200. Just 10% of sales were for homes below $200,000, the traditional entry-level price, noted Diana Olick, reporting for CNBC.

Nonetheless, Redfin’s analysis showed the biggest total sales increases were in more affordable metro areas.

In contrast to new home sales, the median price for all existing home sales in August, as reported by the National Association of Realtors, dropping month-over-month by about $2,000, to $278,200, and the median price of a single-family home fell more than $3,000, to $280,700. About a third of all sales were by entry-level buyers. Redfin, too, said the median price of all homes sold in August was down 1.5% from July, or roughly $6,000, to $312,200.

As was expected, home prices began to creep up again in August as declining mortgage rates increased buyer activity. The quandary for the housing market is whether mortgage rates will continue to slip sufficiently lower to offset the increase in prices and undersupply in inventory, or whether buyers will again retreat from the market as listings become less affordable.

At present, mortgage rates have nosed upward slightly while the growth in home prices has slowed somewhat. If the two hold each other in check, that could help sustain an upward growth trend for the industry and help get it off the seesaw.