U.S. regulators failed to realize the massive risk American International Group Inc's credit default swaps posed and should have stepped in sooner to stop the insurer from originating the products, the head of the Office of Thrift Supervision said on Thursday.

Scott Polakoff, acting director of the OTS, which was AIG's primary regulator, told lawmakers the agency tried to identify and correct some of AIG's weaknesses but should have told the firm to stop creating CDS and divest some of its portfolio.

AIG was successful in many regards for many years, but it had issues and challenges. OTS identified many of these issues and attempted to initiate corrective actions, but these actions were not sufficient to avoid the September market collapse, Polakoff told the Senate Banking Committee in prepared remarks.

The committee is examining why the U.S. government on Monday had to commit another $30 billion for AIG as part of a restructured bailout that had earlier swelled to $150 billion. The company is reeling from massive losses on credit default swaps.

AIG made an internal decision to stop originating CDS -- a form of insurance against bad loans -- in December 2005. But by that point it already had $80 billion in CDS commitments.

Polakoff said many of AIG's problems were also centered in its securities lending business. While many of AIG's liquidity problems were the result of the collateral call requirements on the CDS transactions, the cash requirements of the securities lending program also were a significant factor, he said.

That opinion contrasts with comments from the New York state insurance superintendent, Eric Dinallo, who told the Senate panel that AIG's securities lending unit was being successfully wound down and had manageable losses if not for the firm's massive CDS exposure.

Polakoff said the OTS issued progressively more severe criticisms of AIG's operations from 2005 through 2008 but did not do enough to prevent the firm from becoming a risk to the entire financial system.

In hindsight, we focused too narrowly on the perceived creditworthiness of the underlying securities and did not sufficiently assess the susceptibility of highly illiquid, complex instruments to ratings downgrades and market value declines, he said.

The OTS was the primary regulator of five lenders that failed last year, including IndyMac Bancorp and Washington Mutual, the biggest U.S. bank collapse in history.

Polakoff said the OTS began almost a decade ago regulating AIG, which was one of the first conglomerates the agency supervised. He said the OTS criticized AIG's risk management, corporate oversight, and financial reporting, culminating in a supervisory letter it sent in March 2008 that downgraded AIG's examination rating.

AIG's flaws included over-reliance on financial models, rating agency influence on structured products, lack of due diligence when packaging asset-backed securities, and underwriting weaknesses.

Looking to reform, Polakoff said the CDS market needs more regulation and transparency to prevent the type of flawed models that camouflaged CDS risks.

The CDS market needs more consistent terms and conditions and greater depth in market participants to avoid future concentration risks similar to AIG, he said.

Polakoff also said the OTS endorses the creation of a systemic risk regulator with broad authority to oversee all risk in the U.S. financial system. The regulator's powers should not be limited to companies involved in banking, securities and insurance, he said.

(Reporting by Karey Wutkowski; Editing by Neil Stempleman and John Wallace)