Profits at banks and credit unions climbed during the second quarter as fee income rose and institutions reduce the money they set aside to cover losses on loans, according to separate regulatory reports released Thursday.

In the three years since the official end of the recession, savings institutions have cleaned up their balance sheets by shedding troubled loans. That has allowed them to move money out of rainy-day funds to boost earnings. Raising revenue remains a challenge with interest rates low, but some institutions have upped their fee income through increased lending and trading.

A $5.1 billion spike in trading income, reversing credit derivative losses a year ago, helped lift overall revenue for the banking industry, according to the Federal Deposit Insurance Corp. Net operating revenue during the quarter hit $171 billion, up 3 percent, or $4.9 billion, from the same period a year ago.

The FDIC said banks netted $42.2 billion in earnings in three months ending June, up $7.8 billion, or 22.6 percent, from a year earlier. The average return on assets, a key measure of profitability, inched up 1.17 percent, the highest quarterly gain for the industry since 2007.

“Asset quality continues to recover, loan balances are trending up, fewer institutions are unprofitable...and the number of failures is significantly below levels of a year ago,” FDIC chairman Martin Gruenberg said.

Lending at the nation’s banks crept up by 1 percent, or $73.8 billion, during the second quarter. While to aggregate amount is significant, the pace of lending at banks falls short of credit unions.

Credit unions reported $613.7 billion in total loans in the second quarter, an increase of nearly $14 billion from the previous quarter, according to the National Credit Union Administration. They have posted 5.5 percent loan growth over the last four quarters, the strongest annual growth since early 2009.

The uptick in lending comes as financial cooperatives have attracted more members, nearly 2.1 million in the last four quarters. Membership has now reached 95.2 million across the country.

“The increases in lending, net worth and membership are especially positive signs,” said Debbie Matz, chairman of the NCUA. “The brisk loan growth shows that federally insured credit unions are meeting the needs of more borrowers and putting their assets to productive use.”

Demand for auto loans fueled much of the lending that financial cooperatives recorded in the second quarter, with lending for new vehicles expanded to $66.4 billion and lending for used cars rising to $121.3 billion, according to the NCUA.

“If you look back through the financial crisis, credit unions continued to lend while banks pulled back or completely stop. That trend is just continuing on as the economy gets stronger,” said Dan Berger, president of the National Association of Federal Credit Unions, a trade group.

All told, credit unions pulled in $2.2 billion in net income in the

Even as savings institutions continue to rebound, interest rate risk and legal hangover from the financial crisis still threaten to disrupt gains at the largest banks.

“Banks continued their strong performance with robust earnings supported by a diverse product base, lower losses and an ongoing improvement in asset quality. At the same time, institutions face challenges as they recover from a one-two punch of rising compliance costs and weaker-than-normal loan demand that makes it difficult to grow topline revenue.”James Chessen, chief economist at the American Bankers Association, a trade group.