Goldman Sachs Group Inc sold $5 billion of stock to help fulfill what it called its duty to repay a federal bailout, but the government worries a quick return of funds could pressure other banks to repay their aid prematurely.

The sale of 40.65 million shares at $123 each gives the bank roughly half what it needs to return the $10 billion of taxpayer money it took from the Troubled Asset Relief Program.

We never believed the investment of taxpayer funds was intended to be permanent, Goldman CFO David Viniar said on a conference call on Tuesday. We view it as our duty to return the funds, as long as we can do it without negatively impacting our financial profile, or ability to act as a central liquidity provider to the global capital markets.

Viniar said repayment would depend on regulatory approval and the results of a government stress test gauging Goldman's ability to weather a deep recession. Nineteen banks are undergoing such tests, which are to be completed this month.

Repaying the funds would free Goldman from many government restrictions, including caps on executive pay. Chief Executive Lloyd Blankfein's compensation fell to $1.1 million last year from $70.3 million in 2007, Goldman's proxy filing shows.

The bank said it retains a $164 billion pool of cash and liquid assets that it could use to buy troubled assets and loans as rivals pare their balance sheets.

Tuesday's stock sale came a day after Goldman posted better-then-expected quarterly profit, bolstered by substantial risk taking, and after the bank's shares had more than doubled from their record low of $47.44 last November 21.

Some investors who bought the new stock, however, may have had quick losses. Goldman shares posted their largest percentage drop since January 20, closing down $15.04, or 11.6 percent, at $115.11 on the New York Stock Exchange. A Standard & Poor's index of financial stocks <.GSPF> fell 7.7 percent.

OBAMA EYES BANK CAPITAL, LENDING

The Treasury Department declined to comment on Goldman's plan to repay the TARP funds, but regulators did not indicate any efforts to block it. A Treasury spokesman said that, in general, financial firms raising private capital is a positive step.

While repaying TARP might show Goldman's strength, policymakers worry it could harm the recovery effort by prompting other banks to return their bailout money too soon, limiting lending capacity, a person familiar with the Obama administration's thinking said. The person was not authorized to speak publicly.

White House spokesman Robert Gibbs said President Barack Obama did not want the government to run every troubled bank, and that banks had a need for responsibility in paying employees.

Obama, in a speech in Washington, said that if banks need more capital and cannot raise it privately, the government will force the necessary adjustments and provide support to clean up the lenders' balance sheets.

Goldman converted to a commercial bank in September as a credit market freeze and Lehman Brothers Holdings Inc's bankruptcy upended the Wall Street banking model. The same month, Goldman got a $5 billion investment from Warren Buffett's Berkshire Hathaway Inc .

HIGHER TRADING RISK

Goldman on Monday posted a $1.66 billion first-quarter profit after preferred stock dividends, or $3.39 per share, more than double what analysts had forecast.

Viniar said profit resulting from payments from ailing insurer American International Group Inc rounded to zero in the first quarter.

Goldman's results may raise expectations for rivals scheduled to report this month, including JPMorgan Chase & Co on Thursday, Citigroup Inc on Friday and Bank of America Corp and Morgan Stanley next week.

David Trone, a Fox-Pitt Kelton analyst, said Goldman benefited from a windfall in fixed income, currencies and commodities results that is unlikely to repeat. He rates Goldman in line.

Goldman said its value at risk, or the maximum it would expect to lose daily on 95 percent of trading days, rose to a record $240 million in the first quarter from $197 million in the fourth quarter. It ended the first quarter with $925 billion of assets, up 5 percent from the end of November.

The trading activity suggests Goldman has not backed off in any way from taking risk in the markets, wrote Richard Bove, an analyst at Rochdale Securities.

Lucas van Praag, a Goldman spokesman, said the vast majority of the quarter's risk-taking was on behalf of clients, not the company. He also said value-at-risk measures would not have risen from the fourth quarter had mortgage and credit volatility not increased.

Goldman is paying 5 percent interest on the government's $10 billion preferred stock stake. It also sold the government warrants to buy up to 12.2 million shares at $122.90 each.

Barney Frank, chairman of the House of Representatives Financial Services Committee, said he was pleased about Goldman's plans to repay TARP.

To the extent that we have people pay it back, we should welcome that, he told Reuters.

DANGEROUS ENVIRONMENT

Viniar said the environment remains dangerous in light of extremely difficult macroeconomic conditions and tight credit, which put a premium on liquidity.

But Goldman is doing less to diversify away from businesses sensitive to capital markets and corporate business activity.

Morgan Stanley, for example, is taking a majority stake in a venture combining its brokerage with Citigroup's and has said it plans to bulk up in retail banking.

We're not really a consumer lender, Viniar said.

Repaying TARP could be risky if conditions worsen more than Goldman expects.

Our economists are, I would say, more optimistic or less pessimistic than they've been about the outlook for the economies going into the second half of the year, so that gives us some cause for optimism, Viniar said.

(Reporting by Dan Wilchins, Jonathan Stempel and Christian Plumb in New York; and Ross Colvin, Susan Cornwell, Corbett B. Daly, David Lawder, Matt Spetalnick and Karey Wutkowski in Washington; editing by Andre Grenon, John Wallace and Tim Dobbyn)