NEW YORK – Billionaire investor Warren Buffett on Wednesday defended credit-rating agencies that gave overly positive grades to mortgage-related investments before the housing bust. He said the agencies were among many who missed warnings signs of the crisis.

“They made the wrong call,” Buffett acknowledged.

But he said he counted himself among those who failed to foresee the collapse of the housing bubble. Buffett called it the “greatest bubble” he had ever seen.

“The entire American public was caught up in a belief that housing prices could not fall dramatically,” Buffett told a congressionally chartered panel investigating the financial crisis. Had he known how bad it would get, Buffett said he would have sold his company’s stake in rating agency Moody’s Corp.

Buffett’s investment firm is Moody’s largest shareholder. He testified before the Financial Crisis Inquiry Commission alongside Moody’s CEO Raymond McDaniel. The FCIC is a bipartisan group created by Congress to examine a range of issues surrounding the financial crisis.

Rating agencies have been criticized for giving high ratings to complex investments backed by risky mortgages. When homeowners defaulted, the agencies downgraded billions of dollars of investments at once. That helped spark the financial crisis.

Lawmakers have accused the industry of having a conflict of interest because the agencies are paid by the banks whose investments they rate. Congress is considering new rules for the industry as part of the broader financial regulatory overhaul.

McDaniel told the panel that “Moody’s is certainly not satisfied with the performance of these ratings” and is taking steps to improve its rating process. Still, McDaniel said in written testimony that investors should use ratings as a tool, “not a buy, sell or hold recommendation.”

Despite his company’s stake in Moody’s, Buffett said he doesn’t rely on credit ratings when making investment decisions. He makes his own judgments on companies.

“What we hope for is mis-rated securities because that would give us a chance to make a profit if we disagree with the ratings agencies,” Buffett told the panel.

The FCIC subpoenaed Buffett after he declined to testify voluntarily. Buffett looked relaxed during the hearing and jokingly thanked the panel for the order to appear.

But the Berkshire Hathaway CEO later took pointed questions from the commissioners about whether he personally should have done more to hold Moody’s accountable as the company’s largest shareholder.

“If we can’t count on corporate shareholders, who can we count on?” FCIC chairman Phil Angelides asked Buffett.

Buffett replied that Berkshire invests in many companies and can’t know everything that goes on inside them.

Asked if rating agencies’ model pose risks today, Buffett voiced concern over their ability to grade the debt issued by state and municipal governments.

Angelides noted during his opening remarks that Moody’s profited greatly from rating mortgage-backed securities. Revenue soared from $600 million in 2000 to $2.2 billion in 2007, just as the housing bubble peaked.

But as the company profited, “the investors who relied on Moody’s ratings didn’t do very well,” Angelides said.

Asked why Moody’s ratings failed leading up to the housing crisis, the company’s former managing director, Eric Kolchinsky, blamed a “factory mentality.” Resource-strapped employees were pressured to rate as many deals as possible to grow the company’s market share, he said.

Bankers, in turn, knew they could get their investments rated quickly, even without providing Moody’s sufficient advance notice, Kolchinsky said.

“Bankers knew we couldn’t say no to a deal,” he said. “They took advantage of that.”

Asked to respond, McDaniel said the company declined to rate hundreds, if not thousands of mortgage-backed securities during the housing bubble because of “credit concerns.”

One transaction that has focused attention on rating agencies is a Goldman Sachs deal called Abacus, a complex mortgage-related investment that later plunged in value. Both Moody’s and Standard & Poor’s gave the Abacus deal a AAA rating, the safest rating they offer.