Pushed to the brink of collapse by the mortgage crisis, Bear Stearns Cos. agreed -- after prodding by the federal government -- to be sold to J.P. Morgan Chase & Co. for the fire-sale price of $2 a share in stock, or about $236 million.

Bear Stearns had a stock-market value of about $3.5 billion as of Friday -- and was worth $20 billion in January 2007. But the crisis of confidence that swept the firm and fueled a customer exodus in recent days left Bear Stearns with a horrible choice: sell the firm -- at any price -- to a big bank willing to assume its trading obligations or file for bankruptcy.

"At the end of the day, what Bear Stearns was looking at was either taking $2 a share or going bust," said one person involved in the negotiations. "Those were the only options."

To help facilitate the deal, the Federal Reserve is taking the extraordinary step of providing as much as $30 billion in financing for Bear Stearns's less-liquid assets, such as mortgage securities that the firm has been unable to sell, in what is believed to be the largest Fed advance on record to a single company. Fed officials wouldn't describe the exact financing terms or assets involved. But if those assets decline in value, the Fed would bear any loss, not J.P. Morgan.