NEW YORK (CNNMoney) -- Remember those pesky mortgage-backed securities the Federal Reserve had to take off AIG's hands at the worst of the financial crisis?

The Fed just finished selling all of them, and their return on investment isn't too shabby. The sales of the $19.5 billion portfolio turned a $2.8 billion profit for taxpayers.









"The completion of the sale of the Maiden Lane II portfolio has resulted in significant gains for the public and marks an important milestone in the wind-down of the extraordinary interventions necessitated by the financial crisis," William Dudley, president of the New York Fed, said in a statement.

The New York Fed first indicated last year that it would put the so-called Maiden Lane II securities up for auction. It sold off the first piece of the pie to Credit Suisse (CS) in January. Goldman Sachs (GS, Fortune 500) bought another chunk and Credit Suisse bought the remainder of the portfolio, announced today.

And just who is buying the assets from Credit Suisse and Goldman Sachs? None other than AIG (AIG, Fortune 500) itself.

AIG's Chief Executive Bob Benmosche said Friday that the insurance giant had recently purchased "just under $2 billion of the assets coming out of Maiden Lane II."

"Our crisis is over," he added.

That said, the Fed is not completely out of the woods yet. It still holds a separate portfolio related to the AIG bailout. That portion, called Maiden Lane III, includes the insurer's credit default swap business. Initially worth $29.3 billion when the Fed acquired it, it's now worth $17.6 billion, after many of the securities have matured and much of the loan has been paid back. The New York Fed has not indicated when it plans to start selling the remaining assets.

Amid the financial crisis, the Fed nearly tripled its balance sheet through a variety of emergency measures. While questions remain about how the central bank will eventually unload all of those securities, at the same time, they've been a moneymaker for taxpayers. The Fed recently announced it's turning over $77 billion to the Treasury for its 2011 earnings alone.

As part of the bailouts related to Bear Stearns and AIG in particular, the Fed created three investment vehicles nicknamed "Maiden Lane." Maiden Lane is the name of the street behind the New York Fed.