By Ben Eisen

Bank of America Corp.'s profit tumbled 52% in the second quarter after the bank set aside billions of dollars to prepare for soured loans.

The Charlotte, N.C.-based bank said Thursday that it earned $3.53 billion, versus the $7.35 billion it made a year earlier. Per share, earnings of 37 cents were above the 28 cents that analysts polled by FactSet had forecast.

Profits were hit by an increase in the bank's provision for loan losses, reflecting concern across the banking industry that the recession resulting from the coronavirus pandemic will be worse than initially thought.

The bank set aside $5.12 billion on top of the $4.76 billion it put away last quarter. The provision reflected an additional $3.97 billion that the bank set aside for future losses, as well as $1.15 billion for net charge-offs.

This recession has been unusual in that the federal government has provided unprecedented stimulus to help companies and consumers, and lenders have let customers temporarily skip debt payments. But bank executives are expecting defaults ahead as those programs wear off and the economy remains partially shut.

JPMorgan Chase & Co., Citigroup Inc. and Wells Fargo & Co., the other biggest U.S. banks, collectively socked away $28 billion in the second quarter for loan losses. Bank of America, the second-largest U.S. bank by assets, has a giant U.S. customer base that makes it especially sensitive to the state of the economy.

The bank posted revenue of $22.33 billion, down about 3% from last year.

A bright spot was the bank's capital markets businesses. Extreme market turbulence in March was followed by buoyant stock and bond markets in the second quarter.

Adjusted trading revenue of $4.41 billion was up 35% from $3.27 billion a year ago. Wild markets also powered trading at rivals including JPMorgan and Goldman Sachs Group Inc.

Bank of America posted a 50% jump in fixed-income trading revenue, as well as a roughly 7% rise equities.

Total investment banking fees jumped 57% to a record $2.16 billion, led by an 87% rise in equity issuance. The bank's businesses that help companies issue debt and advise on mergers also had strong growth.

Companies in the second quarter rushed to sell stock and debt to shore up their finances as markets got back to normal and to take advantage of low interest rates.

The bank's net interest income fell 11% to $10.85 billion, while its noninterest income rose 5% to $11.48 billion.

Bank of America shares fell 2.4% in premarket trading Thursday. The lender's stock has fallen about 30% so far this year, slightly outperforming the 34% drop in the KBW Nasdaq Bank Index of large financial institutions.

Write to Ben Eisen at ben.eisen@wsj.com