Here’s the skinny: Late last Wednesday, the New York Fed said in a court filing that in July it had released Bank of America from all legal claims arising from losses in some mortgage-backed securities the Fed received when the government bailed out the American International Group in 2008. One surprise in the filing, which was part of a case brought by A.I.G., was that the New York Fed let Bank of America off the hook even as A.I.G. was seeking to recover $7 billion in losses on those very mortgage securities.

It gets better.

What did the New York Fed get from Bank of America in this settlement? Some $43 million, it seems, from a small dispute the New York Fed had with the bank on two of the mortgage securities. At the same time, and for no compensation, it released Bank of America from all other legal claims.

When I asked the Fed to discuss this gift to the bank, it declined. To understand how the settlement happened, we must go back to the dark days of September 2008. With the giant insurer A.I.G. teetering, the government stepped in. As part of the rescue, A.I.G. sold mortgage securities to an investment vehicle called Maiden Lane II overseen by the New York Fed. A.I.G. was bleeding from its toxic mortgage holdings, many of which were issued by Bank of America, and it received $20.8 billion for securities with a face value of $39.2 billion.

In 2011, aiming to recover some of that $18 billion loss, the insurer sued Bank of America for fraud. The case, filed in New York state court, sought $10 billion in damages from the bank, $7 billion of that related to securities that A.I.G. sold to Maiden Lane II. Bank of America, for its part, argued that A.I.G. had no standing to sue for fraud on the Maiden Lane securities. With the sale, Bank of America contended, the right to bring a legal claim against the bank for fraud passed to Maiden Lane II. That entity, controlled by the New York Fed, never brought fraud claims against the bank.

Not so fast, said A.I.G. Under New York law, which governs Maiden Lane II, an entity has to explicitly transfer the right to sue for fraud, it said. The original agreement between the New York Fed and A.I.G. never specified such a transfer, the insurer contended.