NEW YORK (Fortune) -- Goldman Sachs reported a much stronger-than-expected first-quarter profit Monday, bouncing back from its worst quarter as a public company.

Goldman (GS, Fortune 500) also set plans to raise $5 billion through a sale of stock, saying it wants to become the first big bank to repay the federal loans extended during last fall's financial sector meltdown.

In reporting its results a day earlier than expected, New York-based Goldman said it earned $1.81 billion, or $3.39 a share, for the quarter ended March 31. Analysts surveyed by Thomson Financial were looking for a profit of $1.64 a share.

Goldman shares, which have surged more than 70% during the past month, continued rising late Monday, gaining about 4.7% for the day. Shares were down slightly in after-hours trading.

With the results, Goldman (GS, Fortune 500) bounced back decisively from the last quarter of 2008, when it posted its only quarterly loss since becoming a public company in 1999.

The firm said the latest quarter's gains were driven by big profits in its fixed income business, where revenue surged to $6.56 billion - 34% above the previous record.

"Given the difficult market conditions, we are pleased with this quarter's performance," said CEO Lloyd Blankfein in a statement.

In addition to the record fixed income revenue, which Goldman said was driven by "strong performance in interest rate products, commodities and credit products," Goldman also posted $7.15 billion in trading and principal investment revenue.

But Goldman's principal investments lost $1.41 billion during the quarter, reflecting losses on real estate and a stake in a Chinese bank.

Revenue in Goldman's financial advisory and investment banking businesses declined by 21% and 30% from a year ago, as dealmaking declined, while revenue in its asset management business fell 29%, reflecting the plunge in stock prices over the past year.

Goldman's results come on the heels of last week's announcement from Wells Fargo (WFC, Fortune 500) that its first-quarter earnings would be much stronger-than-expected, and just ahead of reports scheduled later this week from JPMorgan Chase (JPM, Fortune 500) and Citigroup (C, Fortune 500).

Goldman's numbers aren't strictly comparable with the results of its fiscal 2008 first quarter, because the first quarter marks the first full period since Goldman and rival Morgan Stanley (MS, Fortune 500) became bank holding companies. They made that shift last fall, in a bid to ease investor concerns about their access to funding.

As a result of their changed status, both firms committed to report their financial results on a calendar-year basis -- a departure from their previous practice of using a fiscal year that ended in November.

Looking to pay back TARP

Goldman received $10 billion in funding from the Treasury Department last year as part of the government's Troubled Asset Relief Program, or TARP.

While Goldman will still need the approval of regulators at Treasury and the Federal Reserve to repay the TARP money , Monday's announcement is the strongest indication yet of how eager Goldman is to return the funds.

The bank had previously indicated its desire to repay funds but had otherwise avoided making definitive statements about when it would do so.

Goldman's co-president, Gary Cohn, said at a conference last month that he didn't expect any banks to repay TARP funds until after they report first-quarter earnings and regulators have revealed the results of the stress tests they are conducting on big banking companies.

But that changed with Monday's announcement.

"After the completion of the stress assessment, if permitted by our supervisors and if supported by the results of the stress assessment, Goldman Sachs would like to use the capital raised plus additional resources to redeem all of the TARP capital," the company said in a statement about the stock offering.