On Thursday, Sept. 18, 2008, the astonished leadership of the U.S. Congress was told in a private session by the chairman of the Federal Reserve that the American economy was in grave danger of a complete meltdown within a matter of days. "There was literally a pause in that room where the oxygen left," says Sen. Christopher Dodd (D-Conn.).

As the housing bubble burst and trillions of dollars' worth of toxic mortgages began to go bad in 2007, fear spread through the massive firms that form the heart of Wall Street. By the spring of 2008, burdened by billions of dollars of bad mortgages, the investment bank Bear Stearns was the subject of rumors that it would soon fail.

"Rumors are such that they can just plain put you out of business," Bear Stearns' former CEO Alan "Ace" Greenberg tells FRONTLINE.

The company's stock had dropped from $171 to $57 a share, and it was hours from declaring bankruptcy. Federal Reserve Chairman Ben Bernanke acted. "It was clear that this had to be contained. There was no doubt in his mind," says Bernanke's colleague, economist Mark Gertler.

Bernanke, a former economics professor from Princeton, specialized in studying the Great Depression. "He more than anybody else appreciated what would happen if it got out of control," Gertler explains.

To stabilize the markets, Bernanke engineered a shotgun marriage between Bear Sterns and the commercial bank JPMorgan, with a promise that the federal government would use $30 billion to cover Bear Stearns' questionable assets tied to toxic mortgages. It was an unprecedented effort to stop the contagion of fear that seemed to be threatening the rest of Wall Street.

While publicly supportive of the deal, Treasury Secretary Henry Paulson, a former Wall Street executive with Goldman Sachs, was uncomfortable with government interference in the markets. That summer, he issued a warning to his former colleagues not to expect future government bailouts, saying he was concerned about a legal concept known as moral hazard.

Within months, however, Paulson would witness the virtual collapse of the giant mortgage companies Fannie Mae and Freddie Mac and preside over their takeover by the federal government.

The episode sent shockwaves through the economy as confidence in Wall Street began to evaporate. Within days, in September 2008, another investment bank, Lehman Brothers, was on the brink of collapse. Once again, there were calls for Bernanke and Paulson to bail out the Wall Street giant. But Paulson was under intense political pressure from conservative Republicans in Washington to invoke moral hazard and let the company fail.

"You had a conservative secretary of the Treasury and conservative administration. There was right-wing criticism over Bear Stearns," says Congressman Barney Frank (D-Mass.), chairman of the House Financial Services Committee.

Paulson pushed Lehman's CEO Dick Fuld to find a buyer for his ailing company. But no company would buy Lehman unless the government offered a deal similar to the one Bear Stearns had received. Paulson refused, and Lehman Brothers declared bankruptcy.

FRONTLINE then chronicles the disaster that followed. Within 24 hours, the stock market crashed, and credit markets around the world froze. "We're no longer talking about mortgages," says economist Gertler. "We're talking about car loans, loans to small businesses, commercial paper borrowing by large banks. This is like a disease spreading."

"I think that the secretary of the Treasury could not fully comprehend what that linkage was and the extent to which this would materialize into problems," says former Lehman board member Henry Kaufman.

Paulson was thunderstruck. "This is the utter nightmare of an economic policy-maker," Nobel Prize-winning economist Paul Krugman tells FRONTLINE. "You may have just made the decision that destroyed the world. Absolutely terrifying moment."

In response, Paulson and Bernanke would propose -- and Congress would eventually pass -- a $700 billion bailout plan. FRONTLINE goes inside the deliberations surrounding the passage of the legislation and examines its unsuccessful implementation.

"Many Americans still don't understand what has happened to the economy," FRONTLINE producer/director Michael Kirk says. "How did it all go so bad so quickly? Who is responsible? How effective has the response from Washington and Wall Street been? Those are the questions at the heart of Inside the Meltdown."