Wells Fargo & Co. posted double-digit profit growth again, even as the megabank grapples with slowing demand for home loans.

Profits kicked up 13 percent at the San Francisco-based lender, in stark contrast with rival JPMorgan Chase, the country's largest bank, which swung to its first loss in years on its heavy legal expenses. The two banking giants opened the third-quarter bank earnings season Friday against a backdrop cloud of litigation issues swirling around their mortgage practices.

Improved credit quality, broad-based loan growth and a $900 million release from reserves to cover future loan losses helped power Wells Fargo's quarterly profits up 13 percent from a year ago to $5.6 billion, or 99 cents a share. The results topped the consensus Wall Street estimate by about 2 cents, based on a Thomson Reuters survey.

Slowing mortgage activity and reduced investment banking revenue, however, eroded the bank's overall revenue, which at $20.5 billion was down 3 percent from a year earlier and fell short of analyst expectations. The bank's loans grew about 3.6 percent and interest income remained steady, but noninterest income dropped a steep 8 percent, largely on the woes of the mortgage unit, which saw profits drop 43 percent from a year earlier.

Wells Fargo said Friday that it had announced 5,300 full-time job cuts in mortgage production in the third quarter. That's about 8 percent of the 70,000 people in Wells Fargo's consumer lending business, which includes mortgages.

Wells Fargo Chairman and CEO John Stumpf and CFO Tim Sloan have repeatedly said that the bank's myriad business lines will make up for the current down cycle in mortgages. Despite the falloff and uncertainties around the government shutdown and debt ceiling, the overall economy continues improving and the nation's housing market remains on a strong positive track, Stumpf said.

Said Sloan: "We've had a continuation of home price appreciation that I think has surprised everybody."

Sloan said he sees the bank's mortgage originations continuing to slow in the fourth quarter if interest rates stay at current levels.

"In terms of exactly how much, it would be premature to guess right now," Sloan told analysts Friday. "We're early in the quarter."

Joe Morford, a banking analyst at RBC Capital Markets, said he was encouraged by the bank's 3.6 percent loan growth and is still confident Wells Fargo can offset problems in its mortgage unit with its other business lines.

"Going forward, they won't need to lean on those other levers as much since they'll start to benefit from lower expenses in mortgage and probably better revenues," he said. "Big picture, the outlook is still positive."

Trouble is brewing on other mortgage fronts for the bank.

On Oct. 2, New York Attorney General Eric Schneiderman sued Wells Fargo, accusing the bank of "Kafkaesque delays and obstructions" in the loan modification process, allegedly in violation of the landmark $25 billion national mortgage agreement reached to settle lawsuits in 2012.

JPMorgan Chase, meanwhile, disclosed Friday that it set aside an eye-popping $23 billion for litigation, including fines and settlements. The bank has been negotiating extensively with the Justice Department and other authorities over the quality of the mortgage bundles it sold to investors during the housing boom, and there has been talk of an $11 billion settlement.

Last month JPMorgan Chase agreed to pay $920 million in fines to U.S. and U.K. regulators in the multibillion-dollar trading loss caused by a senior employee who was dubbed "the London Whale."

Jennifer Bjorhus • 612-673-4683