The Treasury Department plans to sell the rest of its stake in Citigroup, a move that would allow the government to end its ownership in the bailed-out banking giant while turning a $12 billion total profit for taxpayers.

The agency said in a statement late Monday that it had reached an agreement to sell its remaining 2.4 billion shares in Citigroup for $4.35 apiece, a deal that would net the government proceeds of $10.5 billion.

"By selling all the remaining Citigroup shares today, we had an opportunity to lock in substantial profits for the taxpayer and avoid future risk," Tim Massad, acting assistant Treasury secretary for financial stability, said in the statement. "With this transaction, we have advanced our goals of recovering [Troubled Assets Relief Program] funds, protecting the taxpayer, and getting the government out of the business of owning stakes in private companies."

During the height of the financial crisis in late 2008, Citigroup received more than $45 billion in federal aid in exchange for preferred shares in the company. The government later restructured that package, converting a portion of its holdings into common stock.

The government has continued to sell off portions of its 7.7 billion Citigroup shares over the course of this year. The deal announced Monday is scheduled to close by week's end and is being managed by Morgan Stanley.

When it disposes of its remaining Citigroup shares, the Treasury said, the average selling price for its shares will be $4.14 apiece, up from $3.25 when the government obtained its stake. Citigroup's stock closed at $4.45 on Monday.

The stock sale represents an accelerated federal exit from Citigroup - in a October report, Treasury officials said they planned to "finish selling our investment in Citigroup early next year" - but it is one that both the government and the bank have been eager to finalize.

Administration officials have continued to press in recent months to unwind the various bailouts undertaken during the financial crisis, in part to recoup government money but also to reassure taxpayers and investors that the government has no interest in remaining a stakeholder in private companies.

In the fall, bailed-out insurance giant American International Group finalized plans to pay back government aid. A key element of that plan, much like the deal with Citigroup, would require the Treasury to swap its preferred shares in the company, worth about $49 billion, for about 1.7 billion shares of AIG common stock, and to sell those shares over time.

Last month, rescued automaker General Motors made a successful return to the stock market after its government-imposed bankruptcy reorganization, raising more than $20 billion in an initial public offering. The government still owns about one-third of GM, and how much taxpayers recoup ultimately will depend on the stock price.

Although many smaller banks have yet to pay back money they received, the recent Citigroup, AIG and GM deals have helped to bring the estimated cost of the widely despised $700 billion federal bank bailout program to a mere $25 billion, according to the Congressional Budget Office - far less than estimates just months ago.