Huge trading profits offset declines in banking at Goldman Sachs Group Inc (NYSE:GS) in 2009 as the broader economy struggled.

The New York-based bank reported 2009 full year net revenues of $45.17 billion and net earnings of $13.39 billion. For the fourth quarter, net revenues were $9.62 billion and net earnings were $4.95 billion, or $8.20 per share. This is up from $5.25 in the third quarter and a loss of $4.97 in the fourth quarter of 2008. The fourth quarter earnings per share beat Wall Street expectations of $5.20, according to data compiled by FactSet.

Trading accounted for most of the revenue. Of the $45 billion net revenues for 2009, $34 billion was from trading and investments. Investment banking activities fell $388 million from last year while trading and investments profits nearly quadrupled from the 2008 figure of $9.2 billion.

Trading profits and net revenues were down from the third quarter. Goldman’s net revenue was $9.6 billion compared to the $12.3 billion figure last quarter.

It was able to report higher net earnings from last quarter because total operating expenses fell to $2.2 billion from $7.6 billion. The main driver of this was compensation and benefits. While it reported a $5.4 billion last quarter, it was able to report a negative $519 million figure for the fourth quarter.

The earnings press release explains that “compensation previously accrued was reduced to fund a charitable contribution to Goldman Sachs Gives, the firm’s donor-advised fund, which is reflected in the negative compensation and benefits expenses of $519 million for the quarter”. The same document states that Goldman Sachs gave over $1 billion for the whole year.

In addition to highlighting Goldman’s stellar financial performance, it emphasized its giving and low compensation ratio.

Goldman Sachs repaid the $10 billion TARP money during the year, with $1.42 billion in interest. This amounts to an annualized returned of 23 percent for taxpayers. It also claimed that its compensation to net revenues ratio figure, 35.5 percent, is the lowest since the firm went public. Net revenues were down 2 percent from 2007, yet compensation was down 20 percent, or down $4 billion from 2007.

In pre-market trading, Goldman Sachs is up 0.24 percent while Morgan Stanley (NYSE:MS) is down 0.85 percent, JPMorgan (NYSE:JPM) down 0.51 percent, and Wells Fargo (NYSE:WFC) down .07 percent. PNC Financial Services (NYSE:PNC), a large regional bank, reported earnings this morning of $0.90 per share that beat Wall Street estimates, but is trading down 2.16 percent.