(Bloomberg News) Bank of America Corp. posted the biggest quarterly loss in the lender's history after Chief Executive Officer Brian T. Moynihan booked more costs tied to defective mortgages.

The second-quarter loss of $8.83 billion, or 90 cents a share, compared with profit of $3.12 billion, or 27 cents, a year earlier, the Charlotte, North Carolina-based lender said today in a statement. Adjusted revenue slid 10 percent from the same period last year.

Moynihan, 51, is working to move Bank of America past the fallout from lax home lending by reaching settlements with mortgage bond investors and insurers and setting aside funds for future claims. The loss was smaller than the most pessimistic forecast given last month by the company, which estimated the deficit could range from $8.6 billion to $9.1 billion. The shares were little changed in early New York trading at $9.72.

"At least they're making progress," said Brian Charles, an analyst at R.W. Pressprich & Co. in New York. "Their losses do continue to come down away from mortgages."

Revenue plunged by more than half to $13.5 billion because of previously disclosed mortgage costs. Excluding that charge, revenue slid 10 percent from the year-earlier period and 2.2 percent from the first quarter.

Mortgage Costs

The mortgage unit's loss widened to $14.5 billion from $1.5 billion a year earlier, on the previously announced settlement costs and additions to provisions. Moynihan split management of the division in February, giving Terry Laughlin responsibility over soured mortgages and leaving Barbara Desoer in charge of performing loans. Laughlin, 56, will take over as chief risk officer later this year.

Profit at global banking and markets, run by Thomas K. Montag, advanced 73 percent to $1.56 billion from a year earlier. Sales and trading revenue of $3.8 billion was $666 million more than a year earlier, the bank said. Investment banking fees of $1.6 billion, excluding self-led deals, rose 28 percent from a year earlier. Fixed-income, currency and commodities revenue was $2.7 billion, $467 million higher than a year earlier.

The wealth and investment management business run by Sallie L. Krawcheck reported a $506 million profit, 54 percent higher than a year earlier when it had a charge related to an asset sale. Revenue rose 7 percent from a year earlier to $4.5 billion as the unit added deposits and financial advisers.

Lower Provision

Provisions for future credit losses dropped 60 percent, the bank said, and profit excluding one-time gains and losses was 33 cents a share, beating the 29-cent average estimate of 21 analysts surveyed by Bloomberg.

Moynihan has called his company a "tale of two cities" because its non-mortgage operations are making money. He is seeking to boost results from commercial lending, wealth management and investment banking and limit damage from home loans originated before he became CEO. Global commercial banking reported the highest net income since the second quarter of 2009, according to the bank.