By David Henry

NEW YORK (Reuters) - Just as mortgage bankers were preparing for the end of a historic boom driven by low interest rates, borrowers have begun knocking at their doors again.

In earnings reports last week, JPMorgan Chase & Co <JPM.N>, Wells Fargo & Co <WFC.N> and Citigroup Inc <C.N> said they originated $94 billion worth of new mortgages during the second quarter in their core mortgage operations, an increase of $23 billion, or 31 percent, over the first quarter.

The reason for the sudden burst of business? Mortgage rates have dropped to lows not seen since 2013 after the U.S. Federal Reserve dashed expectations for near-term rate hikes. That has led existing borrowers to try and lock in better rates. New borrowers, meanwhile, have been enticed by low borrowing costs and low down-payment offers.

With mortgage rates near historic lows, and volumes still strong in the early days of the third quarter, banks predict the trend will continue, providing a bright spot in a low-rate environment hammering their wider results.

JPMorgan has added more than 1,000 employees this year to handle the swell in mortgage business, said Mike Weinbach, its chief executive of mortgage banking. He believes U.S. lenders will make about $1.8 trillion of mortgage loans this year, 40 percent more than he had expected at the start of the year.

"We thought the refinance market was going to shrink sharply," Weinbach said in an interview. "We've seen a market that has been much bigger than expected."

All this may be cold comfort to big U.S. lenders that desperately need rates to rise for broader profits to improve. Though low rates bring in new mortgage business and deliver fees from refinancing, banks are hard pressed to generate substantial income when rates fall too low.

Adding to the pressure on margins, US banks’ cost of funding has also risen. The difference between what banks pay for U.S. dollars and the Federal Reserve's expected policy interest rates on Friday hit its widest since August 2012.

At some point, there is little room left between what it costs banks to obtain funds and what they can earn from lending and investing. Rates on short- and long-term debt – known as the yield curve – have come closer together, leaving banks with razor thin margins almost regardless of the type of funding or loans they pursue.

"The headwinds from a flatter yield curve and a lower-for-longer rate environment creates challenges for all financial institutions," said John Shrewsberry, chief financial officer of Wells Fargo, which is the No. 1 U.S. mortgage lender.

Wells, JPMorgan and Citigroup each talked about low rates as the main hurdle to producing better results. Their second-quarter profits fell 3.5 percent, 1 percent and 14 percent from a year earlier, respectively.

The U.S. Federal Reserve set its interest rate target to nearly zero as the markets and economy were spiraling into crisis in 2008. The Fed kept rates there until December, it raised its target by 0.25 percentage points, causing optimism on Wall Street that rates would continue to rise gradually through 2016.

Those hopes have since dimmed. Concerns about market volatility and apparent weakness in the U.S. economy earlier this year, combined with Britain's vote in June to exit the European Union have made it much less likely the Fed will raise rates further in the near-term.

"While the rate situation is challenging, there are a few silver linings in the clouds," one of them being mortgages, said KBW analyst Fred Cannon.

(Reporting by David Henry; Editing by Lauren Tara LaCapra and Andrew Hay)