Federal Reserve Chief Ben Bernanke said that failure to loan up to $30 billion in funds to investment bank Bear Stearns would have led to its bankruptcy and a chaotic chain of events which would have severely shaken confidence in financial markets.

Bernanke, testifying about the economy before lawmakers in Washington on Wednesday, said Bear Stearns told the Fed and other agencies on Thursday, March 13 that it would file for Chapter 11 bankruptcy the next day unless it received alternative sources of funding.

The next day, the Fed in consultation with the Treasury Department announced the loan, which for the first time provided funds from the discount window normally reserved for commercial – not investment – banks.

Our financial system is extremely complex and interconnected, and Bear Stearns participated extensively in a range of critical markets, Bernanke said in prepared remarks.

With financial conditions fragile, the sudden failure of Bear Stearns likely would have led to a chaotic unwinding of positions in those markets and could have severely shaken confidence, he added.

Bernanke made the comments before members of the Joint Economic Committee in the U.S. Congress. He was scheduled to give a more detailed account of the Bear Stearns funding deal on Thursday.

Bernanke acknowledged that the move raised difficult questions about public policy. While the market would sort out the failing and surviving company in a normal situation, the situation presented by Bear Stearns extended beyond that company, he said.

To prevent likely severe consequences the Fed provided the loan. Over the weekend, the JPMorgan agreed to buy Bear Stearns at a fire sale price.