Wells Fargo & Co. announced yet another record quarter Friday, while rival JPMorgan Chase & Co. revealed that its notorious bad trade cost it $5.8 billion, nearly three times its first estimate.

The contrast highlights how Wells Fargo's consumer banking focus has benefited the lender as U.S. investment banks struggle with their greater reliance on trading and potential exposure to eurozone financial woes. In fact, with a current market capitalization of about $177 billion, San Francisco-based Wells Fargo has overtaken JPMorgan as the country's largest bank holding company by market cap, according to SNL Financial.

Wells Fargo, which employs 20,000 people in Minnesota, reported profits of $4.6 billion in the second quarter, up 17 percent from a year earlier and up 9 percent from the previous quarter. Profits were boosted by the bank's home loan machine and cost-cutting, as well as setting aside $400 million less for soured loans.

Revenue rose 4 percent from a year ago to $21.3 billion. Earnings of 82 cents per share beat expectations for 81 cents, based on poll of analysts by Thomson Reuters.

It was Wells Fargo's 10th straight quarter of earnings per share growth as it continues to defy the subpar economic recovery.

Wells Fargo's total interest income was largely flat. Total non-interest income rose 6 percent from a year ago largely on mortgage banking fees, service charges on deposit accounts and other fees.

"Wells is capitalizing on the dislocation of its competitors and the company benefits from a flight to quality," equity analysts for Robert W. Baird & Co. said in a report.

The solid earnings report comes a day after the nation's No. 1 mortgage lender announced that it is paying at least $175 million to settle Justice Department allegations that it discriminated against 34,000 black and Hispanic mortgage borrowers between 2004 and 2009. At the same time it announced it was shutting down its entire wholesale mortgage unit, which funds mortgages that are originated, priced and sold by independent mortgage brokers and is about 5 percent of its funded home mortgage volume.

It continues to operate its separate correspondent mortgage business, which buys mortgages from brokers who already have closed the loans.

The bank said Friday that its second-quarter operating losses increased $47 million from the previous quarter to $524 million and that it included additional litigation accruals related to the Justice Department settlement.

Wells Fargo has been riding a wave of mortgage refinancing driven by record low interest rates, but mortgages for home purchases are increasing, too, Wells Fargo chairman and CEO John Stumpf told analysts.

"Purchase volume was up over $19 billion, or 43 percent, from the first quarter, indicating increased strength in the overall housing market where we've seen increases in sales and pricing in markets throughout the country, even in some of the hardest-hit areas during the downturn," Stumpf said.

The bank has bulked up with acquisitions over the past year, adding to its stash of loans and business lines. In the past year it bought a portfolio of loans backed by U.S. commercial property from Ireland's nationalized Anglo Irish Bank and acquired London-based asset lender Burdale Financial Holdings and the portfolio of Burdale Capital Finance Inc., from Bank of Ireland.

It also bought the North American energy lending business from BNP Paribas and a $6 billion portfolio of short-term "subscription finance" loans from German lender WestLB AG.

Jennifer Bjorhus • 612-673-4683