WASHINGTON — The Federal Reserve was scrambling to prevent a "contagion" from infecting the nation's financial system when it took unprecedented actions to back a Bear Stearns rescue package and provide emergency loans to big Wall Street firms.

The Federal Reserve released documents Friday providing insights into its private deliberations in March that led to those controversial decisions. The Fed's actions came at a time when credit and financial problems were intensifying, threatening to paralyze the entire financial system and plunge the economy into a recession.

Given the fragile conditions of the financial markets at that time, the Fed said it felt compelled to intervene because an "immediate failure" of Bear Stearns would bring about an "expected contagion."

The Fed initially moved on March 14 to provide temporary emergency financing to investment bank Bear Stearns Cos. through an arrangement with JP Morgan Chase & Co. Two days later as the investment bank teetered on the brink of bankruptcy, the Fed agreed to provide backing for up to $30 billion of a deal where JP Morgan would take over the troubled company.

That same day — March 16— the Fed said it would allow big Wall Street firms to go directly to the Fed for emergency loans, a privilege only commercial banks had enjoyed. It was the broadest use of the Fed's lending powers since the 1930s.

The Fed's decision to take this action was "based on recent, rapidly changing developments," the documents said. "These developments demonstrated that there had been impairment of a broad range of financial markets" that Wall Street firms go to for financing.

The Fed's financial lifeline in JP Morgan's takeover of Bear Stearns was subsequently changed to $29 billion and — most recently — to $28.82 billion.

The documents said that the Fed, in discussions on March 16, believed that the takeover — and its involvement in helping to bring it about — was "necessary to avoid serious disruptions to financial markets." The Fed said that "many potential investors" had been invited to back Bear Stearns but the investment firm determined that JP Morgan was "the most suitable bidder."