Long-term US mortgage rates marked their third week of declines this week, after snapping a nine-week run of increases.

Mortgage buyer Freddie Mac said Thursday the rate on 30-year fixed-rate loans fell to an average 4.09 percent from 4.12 percent last week. That was still sharply higher than a 30-year rate that averaged 3.65 percent for all of 2016, the lowest level recorded from records going back to 1971. A year ago, the benchmark rate stood at 3.81 percent.

The average for a 15-year mortgage declined to 3.34 percent from 3.37 percent last week.

Mortgage rates surged in the weeks since the election of Donald Trump in early November. Investors in Treasury bonds bid yield rates higher because they believe the president-elect’s plans for tax cuts and higher spending on roads, bridges and airports will drive up economic growth and inflation.

That would depress prices of long-term Treasury bonds because inflation would erode their value over time, a prospect that caused investors to demand higher yields.

In the latest week, a government report showed that U.S. consumer prices, driven up by rising energy costs, rose moderately in December. That closed out a year in which consumer inflation rose at the fastest pace in five years. The Labor Department reported Wednesday that its consumer price index increased 0.3 percent last month, up from a 0.2 percent gain in November.

To calculate average mortgage rates, Freddie Mac surveys lenders across the country between Monday and Wednesday each week. The average doesn’t include extra fees, known as points, which most borrowers must pay to get the lowest rates. One point equals 1 percent of the loan amount.

The average fee for a 30-year mortgage was unchanged this week at 0.5 point. The fee on 15-year loans also remained at 0.5 point.

Rates on adjustable five-year loans fell to 3.21 percent from 3.23 percent. The fee slipped to 0.4 point from 0.5 point.