The surge in rates could not have come at a worse time for the spring housing market.

Tuesday's move follows positive economic data in retail sales, suggesting that newly imposed tariffs would not hit sales as hard as expected.

A sharp sell-off in the bond market is sending mortgage rates to the highest level in seven years. The average contract rate on the 30-year fixed will likely end the day as high as 4.875 percent for the highest creditworthy borrowers and 5 percent for the average borrower, according to Mortgage News Daily. Mortgage rates, which loosely follow the yield on the 10-year Treasury, started the year right around 4 percent but began rising almost immediately. They then leveled off in March and early April, only to begin rising yet again. Tuesday's move follows positive economic data in retail sales, suggesting that newly imposed tariffs would not hit sales as hard as expected.

Rates have been widely expected to rise, as the Federal Reserve increases its lending rate and pulls back its investments in mortgage-backed bonds. But mortgage rates have reacted only in fits and starts. Read more: Homebuilder sentiment rises on high demand, tight supply "The bottom line is that the writing on the wall has been telling rates to go higher since at least last September," said Matthew Graham, chief operating officer of Mortgage News Daily. "Rates keep looking back to see if the writing has changed, and although there have been opportunities for hope (trade wars, stock selling-sprees, spotty data at times), it hasn't. Today is just the latest reiteration of that writing."

The surge in rates could not have come at a worse time for the spring housing market. Buyers are struggling to find affordable homes for sale, as the supply of listings drops to record lows in most major markets. Home prices are now rising at the fastest rate in four years, according to CoreLogic, and show no sign of easing up. "Homebuyer demand has remained positive and shaken off the higher rate environment so far this year," said Sam Khater, chief economist at Freddie Mac. "However, after years of very low mortgage rates, the symbolic risk of a 5 percent mortgage, on top of higher gas prices, may cause a slowdown in homebuyer demand, particularly in western states and exurbs that are affected more by gas prices than the typical consumer." Higher mortgage rates often chill prices, as sellers have to adjust to what buyers can afford, but with supply and demand so far out of whack, that is unlikely to happen in the near term. If rates move significantly higher, past 5 percent on the 30-year fixed, prices will have to adjust.

WATCH: How to use your home as a source of cash