WASHINGTON – The U.S. Treasury and American International Group have finalized a deal aimed at restoring the troubled insurance giant to independence and repaying the massive taxpayer investment that rescued the company two years ago.

“This is a pivotal milestone as we deliver on our long-standing promise to repay taxpayers, and we thank the American people for their support,” chief executive Robert Benmosche said in a written statement. “With this plan under way, we can concentrate our full attention on managing our businesses for the benefit of all of our stakeholders.”

The plan that AIG detailed Thursday would consist of several parts. Most significantly, the U.S. Treasury would swap its more than $49 billion of preferred shares in the company into about 1.7 billion shares of AIG common stock, the company said. The deal will leave the federal government with a 92.1 percent ownership stake in AIG.

The Treasury expects to sell those shares to investors over time, meaning that AIG’s stock price ultimately will determine how quickly the government can extract itself from the company and how much of the massive taxpayer investment it can recoup.

“The exit strategy announced today dramatically accelerates the timeline for AIG’s repayment and puts taxpayers in a considerably stronger position to recoup our investment in the company,” Treasury Secretary Timothy F. Geithner said in a written statement. “While there is a lot of work ahead to execute the terms of this agreement, today we are much closer to seeing a clear path out.”

The notion of transferring Treasury’s preferred AIG stake into common shares and selling them over time isn’t unprecedented. The government took a similar approach with a portion of its stake in Citigroup last year.

If successful, the approach could represent a triumph for the company and the government, which committed more than $180 billion to rescuing AIG during the financial crisis. The strategy depends heavily on AIG’s ability to convince investors that it can operate as a viable insurance company.

Before the Treasury transaction takes place, possibly in the first quarter of 2011, AIG intends to first satisfy more than $20 billion in outstanding loans from the Federal Reserve Bank of New York by completing the $15 billion sale of American Life Insurance Co., or Alico, to MetLife and undertaking a public offering of shares in Asia-based American International Assurance.

In addition, the New York Fed currently has a $26 billion stake in two “special purpose vehicles” that hold equity from Alico and AIA. Under the plan laid out Thursday by AIG, the company would draw down $22 billion of funds from the government’s bank bailout program to essentially buy out the Fed’s stake. AIG would then immediately transfer those interests back to the Treasury, in addition to apply proceeds from future asset sales to pay off any remaining debt to the Fed.

The government largely nationalized AIG in September 2008, when the New York Fed extended an $85 billion emergency loan and took an 80 percent stake in the company. The recent collapse of Lehman Brothers investment bank had left markets reeling, and AIG was teetering on the edge of bankruptcy, largely due to a troubled portfolio of exotic financial derivatives written by a subsidiary.

That bailout eventually grew to a taxpayer commitment of more than $180 billion, though the company’s actual tab has continued to decrease over the past year.