Of the two big Fed loans, the smaller one, the $38 billion supplementary lending facility, was extended solely to prevent further losses in the securities-lending business. So far, $18 billion has been drawn down for that purpose.

For securities lending, an institution with a long time horizon makes extra money by lending out securities to shorter-term borrowers. The borrowers are often hedge funds setting up short trades, betting a stock’s price will fall. They typically give A.I.G. cash or cashlike instruments in return. Then, while A.I.G. waits for the borrowers to bring back the securities, it invests the money.

In the last few months, borrowers came back for their money, and A.I.G. did not have enough to repay them because of market losses on its investments. Through the secondary lending facility, the insurer is now sending those investments to the Fed, and getting cash in turn to repay customers.

A spokesman for the insurer, Nicholas J. Ashooh, said A.I.G. did not anticipate having to use the entire $38 billion facility. At midyear, A.I.G. had a shortfall of $15.6 billion in that program, which it says has grown to $18 billion. Another spokesman, Joe Norton, said the company was getting out of this business. Of the government’s original $85 billion line of credit, the company has drawn down about $72 billion. It must pay 8.5 percent interest on those funds.

An estimated $13 billion of the money was needed to make good on investment accounts that A.I.G. typically offered to municipalities, called guaranteed investment contracts, or G.I.C.’s.

When a local government issues a construction bond, for example, it places the proceeds in a guaranteed investment contract, from which it can draw the funds to pay contractors.

After the insurer’s credit rating was downgraded in September, its G.I.C. customers had the right to pull out their proceeds immediately. Regulators say that A.I.G. had to come up with $13 billion, more than half of its total G.I.C. business. Rather than liquidate some investments at losses, it used that much of the Fed loan.