Insurance giant American International Group (AIG) has signed a debt repayment deal with Federal Reserve Bank of New York, paving way for the Treasury Department to sell a significant stake in the company early next year.

AIG was bailed out by the U.S. government in 2008 at a size that eventually swelled to $182 billion from the original investment of $85 billion.

In a regulatory filing, AIG said it will repay $20 billion it owes to New York Fed by using proceeds from the recent sale of American Life Insurance, as well as from its October public offering of Asia-based AIA Group. Both transactions fetched net cash of $27 billion in total.

"...the definitive recapitalization agreement with the government marks an important step forward in our progress toward completely repaying taxpayers. We remain committed to executing the steps and meeting all conditions in the agreement as soon as possible," AIG said in a statement.

In the process of repaying the New York Fed loan, AIG also opens the door for the Treasury Department to begin to recover its huge investment in the insurance firm. Meanwhile, AIG will book a charge of about $4.7 billion in its earnings over the repayment of New York Fed loan.

The Treasury, which has invested about $49 billion in AIG, is expected to convert its preferred stake into 1.66 billion shares of common stock, boosting its stake in the global insurer to more than 92 percent from its current ownership of 79.8 percent.

The debt repayment deal paves the way for a potential public offering next spring in which the Treasury could sell off a sizable portion of its shares in the company.

The Treasury is aiming to sell at least $15 billion of its shares in AIG in the first of a series of stock offerings starting in the first quarter of 2011, the Wall Street Journal reported citing people familiar with the matter.

A $15 billion share sale would represent roughly a quarter of the government's stake as implied by AIG's current stock price of $42.22. The Treasury investment will break even if shares are sold at about $29 apiece as it is hoping to earn a profit on investment from sale of AIG shares.

According to the regulatory filing, AIG is allowed to raise at least $3 billion in an offering by August 15, 2011 and potentially another $4 billion on top of that subject to the Treasury's consent.

AIG has the right to conduct two primary offerings per year and the Treasury Department may decide to participate in those offerings, and to prevent AIG from selling any equity securities.

The filing also says the Treasury will maintain "complete control" over the terms of any stock sales until its stake falls below 33 percent.

The U.S. government is selling its stakes in companies that taxpayers bailed out during the credit crisis. Recently, the Treasury sold its remaining stock in Citigroup Inc. for $10.5 billion and clocked in a profit of about $12 billion.

Last month, the Treasury almost halved its 61 percent stake in General Motors when the bailed-out automaker returned to the stock market. However, it remains unclear whether the Treasury will break even on that investment and it needs to at least six months before selling additional shares in GM stock. Recently, GM raised more than $23 billion in the world's largest IPO.

Meanwhile, AIG's shares have gained 45 percent this year as investors welcomed Chief Executive Robert Benmosche plans to get out of government support by stabilizing core operations, tapping the debt markets and disposing of some assets. The New York-based insurer has raised billions of money in the recent months.

In October, the insurer divested a majority stake in AIA Group Ltd. for more than $20 billion and sold American Life Insurance Co. last month to MetLife Inc. for $16.2 billion. In November, AIG sold $2 billion of bonds in its first offering since the bailout.

Though, the upcoming AIG offering would be only a secondary thing, not an IPO, but could still rank among one of the biggest follow-on stock offerings of all time.

Shares of AIG closed Wednesday's regular trading session at $42.22 on the NYSE. For the past 52-weeks, they have touched a high of $45.90 and a low of $21.54.