Prashant Gopal
Bloomberg News

Mortgage rates for 30-year loans surged in the last week to the highest level in almost two years, increasing borrowing costs at a time when the housing market is strengthening and prices are jumping.

The average rate for a 30-year fixed mortgage rose to 4.46 percent from 3.93 percent, the biggest one-week increase since 1987, according to mortgage guarantor Freddie Mac.

The rate was the highest since July 2011 and above 4 percent for the first time since March 2012. The average 15-year rate climbed to 3.5 percent from 3.04 percent.

The increase, sparked by expectations that the Federal Reserve will scale back bond purchases, provides a test for a yearlong housing recovery that’s been fueled by home-loan costs near record lows.

Buyers seeking to take advantage of low rates are competing for a tight inventory of listings, driving up values. House prices in 20 U.S. cities rose 12 percent in April, the biggest year-over-year gain since March 2006, according to data released this week.

Higher mortgage rates are “not going to snuff out the housing recovery,” Paul Diggle, property economist for Capital Economics Ltd., said Wednesday in a telephone interview from London. “But it’s another reason to expect a slowdown from the very rapid rate of price rises of late.”

Capital Economics on Wednesday increased its 2014 mortgage-rate forecast for 30-year loans to 5 percent from a previous estimate of 3.75 percent. The rate, which has jumped from 3.35 percent in early May, leaped after Fed Chairman Ben S. Bernanke said last week that policy makers may slow bond purchases this year amid signs of an improving economy.

At the current rate, the monthly payment on a $300,000 30-year loan has increased to $1,513 from $1,322 in May.

Contract signings to buy previously owned homes climbed 6.7 percent in May to a six-year high, suggesting rising mortgage rates may be providing a “spark,” the National Association of Realtors said in a Thursday report.

KB Home, a Los Angeles-based builder, said demand is outpacing supply in all of its markets, even with the increase in borrowing costs.

“Anecdotally, we are hearing from the sales floor that the uptick in rates has actually created an increased sense of urgency” among buyers, Chief Executive Officer Jeffrey Mezger said Thursday during a company earnings conference call.

Borrowing costs are still relatively low. The average rate for a 30-year mortgage over the past 10 years is 5.31 percent, according to data compiled by Bloomberg.

During the housing market’s boom, existing-home sales reached a peak annual pace of 7.25 million in September 2005 with 30-year mortgage rates at about 5.8 percent. Home sales last month, with rates below 4 percent, were at a pace of 5.18 million.

Rates would have to rise to almost 7 percent before a home at the U.S. median price would be unaffordable to a family making the median income in most parts of the country, according to a Freddie Mac study this month.

“While rising interest rates will reduce housing demand, rates would have to increase considerably more before the reduction in demand for home purchases would be substantial across the country,” Chief Economist Frank Nothaft wrote.

The increase “will not meaningfully impact the fundamental recovery in demand because affordability remains high relative to history,” said Joseph Lavorgna, chief U.S. economist at Deutsche Bank Securities Inc., in a Wednesday note to clients. “Rates are also rising partly because of expectations of an improving economy. Hence, rising job and income prospects will offset some of the now-higher mortgage financing costs.”