Originations for refinance mortgages skyrocketed in the fourth quarter even as purchase originations dropped. This increase could have been the final stand for refis before rising interest rates force a slow-down.

A total of 1.7 million loans were originated on U.S. residential properties in the fourth quarter, according to the Q4 2016 U.S. Residential Property Loan Origination Report from ATTOM Data Solutions, a fused property database. This is down 15% from the previous quarter but still up 2% from the year before.

Of those originated, a total of 883,836 were refinance loans in the fourth quarter. This is down 6% from the previous quarter but still up 20% from a year ago — the second consecutive quarter with a year-over-year increase.

“Refinance originations continued to post strong numbers compared to a year ago in the fourth quarter, even as purchase originations decreased on a year-over-year basis for the second consecutive quarter,” ATTOM Senior Vice President Daren Blomquist said. “The increase in refinance originations is surprising given the rising interest rates in the fourth quarter, but many homeowners may have been trying to lock in still relatively low interest rates before those interest rates rose further.”

However, over the past few weeks, rising interest rates turned the mortgage markets away from refinances and toward purchases, a move that First American Financial Corp. calls risky.

For the entire year, 7.3 million loans were originated, up 2% from 2015 and the highest for any year since 2013. The total dollar volume of originations increased 8% from the previous year to more than $461 billion in the fourth quarter.

The loan origination report is derived from publicly recorded mortgages and deeds of trust collected by ATTOM Data Solutions in more than 950 counties, accounting for more than 80% of the U.S. population.

And the lenders that gained the most from the uptick in originations during the fourth quarter were the nonbanks. Quicken Loans came in as the top purchase loan originator with 14,678 loans, followed by Caliber Home Loans with 12,075, Wells Fargo with 10,826, Fairway with 9,149 and JP Morgan Chase with 7,994.

What’s more, while the nonbanks increased their originations for the quarter, banks saw a decrease. Quicken, Caliber and Fairway increased 4%, 21% and 19% respectively while Wells and Chase decreased 5% and 15% respectively.