WASHINGTON — U.S. banks had second-quarter net income of $40.2 billion, the second-highest total on record, as lenders cut expenses and workers to compensate for falling trading revenue, the Federal Deposit Insurance Corp. said.

Loan growth returned to levels last seen before the 2008 credit crisis, but failed to boost revenue as mortgage servicing and refinancing declined, the FDIC said Thursday in its Quarterly Banking Profile. The report overall showed continuing recovery by the industry, even as banks cope with pressure resulting from slow economic growth, FDIC Chairman Martin Gruenberg said in Washington.

“Net income was up, asset quality improved, loan balances grew at their fastest pace since 2007, and loan growth was broad-based,” Gruenberg said. Challenges facing banks include pressure from narrow net interest margins and “increasing higher-risk loans to leveraged commercial borrowers,” he said.

Lending was up for the quarter, with loan and lease balances growing 2.3 percent – the fastest growth since 2007. Residential mortgages saw a 1.2 percent rise, and the banks saw a 3.1 percent increase in commercial and industrial lending.

Trading income fell a fourth straight quarter, dropping 10.1 percent, the FDIC said.

Banks continued bolstering their bottom lines by cutting funds set aside for bad loans, Gruenberg said. Industrywide earnings were boosted as banks set aside the lowest amount of loan-loss reserves in eight years and cut 37,282 employees.

Wells Fargo & Co. reported a 3.8 percent increase in net income on lower credit costs even as other big banks were a drag on industry revenue. Bank of America Corp, the second-biggest U.S. bank, had a 43 percent decline in profits after spending $4 billion on litigation costs. JPMorgan Chase & Co. net income fell 7.9 percent from a year ago.

“Businesses are more confident about lending, banks have the capacity to lend to them, and they’re aggressively trying to do that,” said James Chessen, chief economist at the American Bankers Association. Because banks are “anxious to get money on the street,” Chessen said, they are pressured to give competitive rates – a point of interest-rate risk being monitored by the FDIC, according to Gruenberg.

The FDIC is also focusing on leveraged lending – such as in funding for mergers and acquisitions – and expects the multi-agency Shared National Credit review will highlight the topic next month.