A surprise spike in mortgage rates threatens to halt a refinancing boom that has delivered strong profits for U.S. banks over the past two years.

The average rate on a 30-year mortgage rose to 4.15% last week, a 14-month high and up sharply from 3.59% in early May, according to the Mortgage Bankers Association. A separate survey released Thursday by Freddie Mac said the rate this week was at 3.98%, up from 3.35% last month.

Refinancing applications last week were down 36% from the first week of May, before rates began climbing, according to the bankers association.

Lenders have been predicting that refinancing would taper off, "what wasn't anticipated was that this move in rates would happen so quickly," said Bose George, a mortgage-finance company analyst with Keefe, Bruyette & Woods.

While a falloff in refinancing business could cut into record profits lenders have enjoyed from the activity, a rise in short-term interest rates could see banks earning higher yields on various types of loans, from mortgages to commercial real estate.