JPMorgan Chase on Friday reported a third-quarter loss after a big charge for legal expenses. (Paul Sakuma/AP)

Mortgage production at JPMorgan Chase and Wells Fargo fizzled in the last quarter, the banks said Friday, as fewer borrowers sought to refinance their home loans amid rising interest rates.

The slowdown for the nation’s largest mortgage lenders reflects a shift in the housing recovery, which has largely been relying on refinance activity. Industry analysts anticipated the boom to peter out this year as the number of loans eligible for interest rate reductions dropped. But some suspect that the Federal Reserve’s signal this spring that it could reduce its stimulus program hastened the decline.

The central bank’s monthly bond purchases have tamped down interest rates to the benefit of banks, which witnessed an influx of homeowners eager to take advantage of lower rates. Interest rates crept up and homeowners backed off in the last quarter, after the Fed indicated it would ease the pace of purchases as the economy improved.

While rates have come down in the last few weeks as the Fed surprised markets by saying that it would hold steady on its stimulus efforts, the average rate on a 30-year mortgage still sits at 4.23 percent, up from 3.34 percent a year ago, according to mortgage finance giant Freddie Mac.

As the largest home loan lender, Wells Fargo felt the most pain from rising rates. The bank reported $1.6 billion in mortgage banking income for the third quarter, a 43 percent drop from the same period one year earlier. Wells Fargo said it received $87 billion worth of mortgage applications last quarter, compared with $188 billion a year ago.

“While refinance volume is down and has an impact on our business, the overall improvement in the housing market is still good for Wells and good for America,” John Stumpf, chief executive of Wells Fargo, said during a phone call with analysts Friday. “An interest from Americans in homeownership is still there.”

In spite of the slowdown in the mortgage market, Wells Fargo reported a 13 percent jump in third-quarter profit, which penciled in at $5.6 billion, or 99 cents, per share. Improvement in the quality of the bank’s loans and a $900 million release in its reserves bolstered its earnings.

At JPMorgan, loan originations tumbled 14 percent year over year to $40.5 billion. Nevertheless, the nation’s largest bank pulled down $705 million in income from mortgage banking during the quarter, a 13 percent increase from the prior year.

JPMorgan’s legal headaches, however, have overshadowed all other business activity, leading to the bank’s first quarterly loss since 2004.

After incurring $9.2 billion in legal expenses, the bank posted a loss of $380 million, or 17 cents per share, in the third quarter, compared with a net income of $5.7 billion, or $1.40 per share, a year ago.

Stripping out the legal expenses and release of reserves — a tactic banks use to boost earnings — JPMorgan earned $5.8 billion, or $1.42 per share, in profit.

In the last three months, JPMorgan has handed federal and international authorities nearly $2 billion in fines and penalties. The lion’s share of that money, a total of $920 million, went to U.S. and British regulators to resolve inquiries into the bank’s handling of the disastrous “London Whale” trading losses.

That settlement pales in comparison with the $11 billion agreement JPMorgan is negotiating with the Justice Department over its sale of mortgage-backed securities.

“While we had strong underlying performance across the businesses, unfortunately, the quarter was marred by large legal expense,” Jamie Dimon, chief executive of JPMorgan, said in a statement.