Citigroup said it has repaid the $20 billion in bailout money it received from the government.

Citi said it funded the previously announced repayment with a recent stock offering that raised $20.5 billion. The offering included $17 billion in common shares and $3.5 billion in what are called tangible equity units, which can be converted into common stock at a later date.

Citi said it also ended its $7.1-billion loss-sharing agreement with the government, which protected the company against defaults on some risky investments. To end the program, the government cancelled $1.8 billion of what are called trust preferred securities, but still holds $5.3 billion in those securities, which are a type of debt instrument.

New York-based Citi was among the hundreds of banks that received bailout money through the Troubled Asset Relief Program. The Treasury Department extended a total of about $453 billion to banks, insurers, automakers and other companies under the program. The government has said it expects total bank repayments could reach $175 billion by the end of next year.

Repayment of the money frees banks from government restrictions, such as executive pay limitations.