SunTrust Banks Inc posted its third straight quarterly loss on Wednesday , hurt by an increase in soured commercial and residential loans.

The net loss applicable to common shareholders of the Atlanta-based bank was $164.4 million, or 41 cents per share, compared with a profit of $530.4 million, or $1.52, a year earlier.

Analysts on average forecast a loss of 51 cents per share, according to Reuters Estimates. SunTrust took a $48.4 million charge to contribute to a federal deposit insurance program.

Borrowers on $5.5 billion, or nearly 4.5 percent, of all SunTrust loans were not current on payments. Recession-related costs continue to impact our results, Chief Executive James Wells said in a statement.

The bank set aside $962.2 million for credit losses, more than twice the year-earlier level, citing the housing market and increasing economic stress in the commercial market. Net charge-offs totaled $801.2 million, with increases in nearly all categories.

SunTrust took $4.9 billion of money from the government's Troubled Asset Relief Program, but regulators have not allowed it to pay that sum back.

The bank was one of 19 large U.S. banks to undergo stress tests of their ability to weather a deep recession, and was ordered to raise $2.16 billion, which it has done.

Shares of SunTrust closed Tuesday at $15.18 on the New York Stock Exchange. Through Tuesday, they have fallen 49 percent this year, compared with a 19 percent decline in the KBW Bank Index <.BKX>.

(Reporting by Jonathan Stempel; Editing by Derek Caney)