JPMorgan Chase, the country's biggest bank by assets, reported a record quarterly profit Friday. The bank said it made $5.3 billion in earnings for common shareholders, a widely used measurement, from July through September, up 36 percent from the same period a year ago. Above: JPMorgan Chase offices in San Francisco.

The country’s two biggest mortgage lenders, Wells Fargo and JPMorgan Chase, reported Friday that a surge in home lending pushed them to record profits.

JPMorgan CEO Jamie Dimon declared that the housing market “has turned the corner.” Wells Fargo CEO John Stumpf said that “every quarter, we have more confidence.”

Wells said it issued $139 billion in mortgages from July through September, compared with $89 billion in the same period last year. JPMorgan wrote $47 billion in mortgages, compared with $37 billion last year.

There were signs, though, that the boom isn’t as strong as it might seem. The large majority of mortgage lending was driven not by people buying new homes but by owners refinancing mortgages, which is less helpful to the housing market.

The business was also propped up by government programs, like a federal initiative meant to encourage refinancing, and the Federal Reserve’s pledge to buy more mortgage-backed bonds.

The banks’ mortgage units are also a magnet for legal disputes, with both banks facing new mortgage-related lawsuits just this month. And nobody knows how long the revenue gains will last.

“We don’t expect to count on the high margins and mortgage origination forever,” Dimon said in a call with financial analysts. “You’re going to have it next quarter, maybe for a couple of quarters after that, but it won’t last for that much longer.”

Still, the numbers were eye-catching: Mortgage lending revenue jumped 56 percent at Wells and 29 percent at JPMorgan compared with a year ago, driving overall revenue gains at both banks.

And it’s all against a backdrop of signs nationwide that the fractured housing market could be healing. A Federal Reserve survey earlier this week found that a stronger housing market helped economic growth in almost every part of the country. Home sales are up, prices are rising more consistently in most places, and builders are more confident.

The executives didn’t suggest that one quarter of mortgage strength means the housing market is fixed. At both banks, about three-quarters of the mortgage-lending revenue was from refinancing. About 15 percent was from a government program, the Home Affordable Refinance Program.

The Fed’s plan last month to buy mortgage-backed bonds is also likely to fuel the numbers. The plan is meant to keep interest rates low, which is supposed to encourage borrowing and refinancing. It can also help banks make a bigger profit when they sell mortgages to investors.

Stumpf, the Wells Fargo CEO, said that the Fed plan was enabling the bank to hire.

Wells and JPMorgan are bellwethers for mortgages. Wells controls a third of the market, according to the trade publication Inside Mortgage Finance. JPMorgan is second, controlling about 11 percent.

Both banks cited low interest rates to help explain the boost in refinancing, though it wasn’t clear why this quarter was so strong. Rates have been low for several years.

The average interest rate on a 30-year fixed mortgage is 3.47 percent, according to the government-sponsored mortgage giant Freddie Mac. It’s been under 4 percent for almost a year.

There are still plenty of homeowners who can’t afford their mortgages, a point that Dimon was quick to note. He said his bank is still seeing a high level of souring mortgage loans, and said he expects high default-related expenses “for a while longer.”

Stumpf acknowledged that the housing market is still “not back to where we need to be, and it is not as robust as we would all want it to be.”

Shoddy lending standards helped cause the 2008 financial crisis, and both banks are still dealing with the hangover.

Last week, the New York attorney general sued JPMorgan over the risky mortgage-backed securities once peddled by Bear Stearns, which JPMorgan later bought. JPMorgan says it will contest the charges.

This week, the federal government sued Wells Fargo, charging that the bank improperly received millions of dollars’ worth of government insurance payouts for failed mortgage loans. Wells Fargo denies the charges, and says that it has already settled many of the issues raised in the lawsuit with the government.

Both banks are also still dealing with demands from investors that they buy back mortgages they sold in the run-up to the financial crisis.

Some highlights from both banks’ earnings reports:

— JPMorgan: The bank made $5.3 billion in the third quarter, up 36 percent from the same period a year ago. It worked out to $1.40 per share, blowing away the $1.21 predicted by analysts polled by FactSet, a provider of financial data.

— Wells Fargo: Wells made $4.7 billion in the third quarter, up 23 percent from the same period a year ago. That amounted to 88 cents per share, a penny higher than estimates. Overall revenue rose 8 percent to $21.2 billion, slightly lower than analysts expected.

JPMorgan’s stock fell about 1 percent, losing 48 cents to $41.62, although it fared much better than other financial stocks. Wells Fargo’s stock fell more than 2 percent, losing 93 cents to $34.25.

*We welcome your comments on the stories and issues of the day and seek to provide a forum for the community to voice opinions. All comments are subject to moderator approval before being made visible on the website but are not edited. The use of profanity, obscene and vulgar language, hate speech, and racial slurs is strictly prohibited. Advertisements, promotions, spam, and links to outside websites will also be rejected. Please read our terms of service for full guides