Citigroup Inc repaid $20 billion to the United States, as the bank works to reduce government involvement in its compensation practices.

The bank sold $17 billion in common shares and $3.5 billion in convertible notes to help raise capital to repay the government.

Citigroup received $45 billion under the U.S. Troubled Asset Relief Program last year over two separate bailouts. In a third bailout this year, the U.S. agreed to swap the Citigroup preferred shares it owned into $25 billion of common stock and another $20 billion of more debt-like securities.

Citigroup has repaid the $20 billion, but taxpayers still own common stock in the bank that is now worth about $25.2 billion.

The U.S. had planned to sell up to $5 billion of that stock alongside Citigroup's share offering, but demand for the bank's sale was so low that any government sale would have resulted in a loss for taxpayers.

Citigroup and the U.S. also ended an agreement to guarantee a roughly $250 billion portfolio of assets against losses.

With these steps, the bank is no longer subject to the oversight of U.S. pay czar Kenneth Feinberg, who had previously had say over compensation for the bank's top 100 employees.

(Reporting by Dan Wilchins; Editing by Phil Berlowitz)