By Dan Wilchins

NEW YORK (Reuters) - Citigroup Inc and Wells Fargo & Co said they were paying back funds to the U.S. government, in transactions that will end taxpayers' capital support of the biggest U.S. banks much sooner than had been expected just weeks ago.

With regulators signing off on the plans, the U.S. government is signaling that it is comfortable removing some of the support it has provided to banks since the failure of Lehman Brothers Holdings created pandemonium in financial markets in the fall of 2008.

The banks are hoping to escape some of the added regulatory scrutiny that came with U.S. support. The Obama administration's pay czar, Kenneth Feinberg, had to sign off on pay for Citigroup's top 100 employees after the bank received more than $45 billion of capital over three bailouts.

Wells Fargo received only one government capital injection of $25 billion and was subject to fewer restrictions.

Both banks faced pressure to repay the United States after Bank of America Corp announced plans to sell more than $18 billion of equity to help repay the $45 billion it received from the government under the Troubled Asset Relief Program, analysts said.

Citi and Wells Fargo became the last big banks to leave TARP.

"The stigma of being in TARP just got to be too much," said Ralph Cole, portfolio manager at Ferguson Wellman Capital Management in Portland, Oregon.

But the government and the banks that have left TARP are taking a risk. If the economy weakens considerably next year, more bailouts could be necessary.

Citigroup Chief Executive Vikram Pandit is giving up a government guarantee the bank had against excessive losses on $250 billion of assets. The bank has yet to consistently post real profits from its banking operations.

"There are a lot of risks still embedded in the economy. Look at commercial real estate, or what happens to consumer loans if unemployment rises," said Bill Fitzpatrick, a stock analyst at Optique Capital Management in Milwaukee. "We don't know what things will look like a year from now."

Banks are evidently concerned about the economy, and have been reducing their loan books and boosting their investments in risk-free securities. President Barack Obama told top U.S. bankers on Monday that they had to open up the credit spigot for small businesses and start lending again.

Still, many investors now believe the worst is behind the U.S. economy, in part because of extreme efforts by the government and the Federal Reserve to rescue the financial system.