Goldman Sachs demanded billions of dollars in collateral from AIG to protect its customers, the Wall Street bank said on Thursday, defending itself against accusations that it contributed to the insurer's woes while padding its own profits.

But an American International Group official questioned Goldman's lack of flexibility in the 2007-2008 dispute over credit default insurance products linked to baskets of loans that included subprime mortgages.

Elias Habayeb appeared alongside other former and current executives from AIG and Goldman as the Financial Crisis Inquiry Commission continues its two-day-long hearing about the role of derivatives in the financial crisis.

It was the second day where Goldman and AIG officials traded barbs in a debate over whether Goldman pushed too aggressively for collateral and contributed to the insurer's need for a government bailout pledge of up to $182 billion.

Habayeb said AIG's counterparties would not cooperate during negotiations. Not even the threat of bankruptcy by AIG or its financial products unit would extract discounts, he said.

Unfortunately AIG had little negotiating leverage, said Habayeb, who was chief financial officer of the firm's financial services division and has just returned to the company.

Goldman Sachs has been dogged by criticism that it received a backdoor government bailout when taxpayer funds were funneled into an insolvent AIG, starting in September 2008, to help pay off counterparties like Goldman.

By March 2009, Goldman had received $12.9 billion of the $93 billion in money paid to AIG counterparties, the most of any bank.

The crisis panel is examining the collateral dispute as part of its larger investigation of what caused the financial crisis that peaked in 2008, sending global markets reeling and U.S. unemployment skyrocketing.

The congressionally appointed panel is due to deliver its findings by December 15.

PRICING DISPUTE

Goldman Chief Financial Officer David Viniar said the firm's demands were for its customers, not Goldman itself. He said Goldman's exposure to AIG was designed to help its customers manage their own risks.

Panel chairman Phil Angelides, as he did Wednesday, asked if Goldman was driving prices down on the types of debt securities that were linked to the credit insurance sold by
AIG.

We never instruct people to mark these down, Viniar said. We don't believe you can't mark things to market. If you can't mark things to market, you can't manage your risk.

But Angelides wondered how one could get a fair price in an illiquid market.

Telling someone you have the right to buy this... in an illiquid market ain't much of an offer, he quipped.

Goldman's defense of its client focus comes as the firm is facing civil fraud charges from the U.S. Securities and Exchange Commission. The case filed in April alleges that Goldman misled investors in marketing a mortgage-linked financial product.

At the heart of AIG and Goldman's dispute is accounting.

Goldman and other counterparties to AIG's financial products unit marked the value of their exposure to fair market value -- what the underlying securities could currently fetch in the open market.

AIG, however, was valuing its related exposures on a longer-term horizon.

Once the housing market started its downward plunge in 2007, Goldman and other counterparties marked down the value of their exposures and demanded that AIG pay up collateral.

In late July of 2007 Goldman made a $1.8 billion demand to AIG. Goldman says AIG balked, in a dispute that lasted months until the government stepped in with its rescue.

Viniar said it was Goldman's vigorous commitment to accounting rules that forced it to pursue the big collateral calls.

He said the firm tried to work with AIG to agree on values for the financial products.

AIG's Habayeb, however, said its counterparties had little motivation to earnestly negotiate, because even if AIG went bankrupt the counterparties would get special protection under bankruptcy law.

AIG's efforts to stem the tide of collateral calls and reduce FP's risk exposure by negotiating with counterparties, including Goldman Sachs, during this period were largely unsuccessful, Habayeb said in his written testimony.

(Reporting by Karey Wutkowski, Steve Eder, Kim Dixon and Rachelle Younglai; Editing by Tim Dobbyn)