NEW YORK — Stocks rallied Monday as investors placed bets that a recovery in the financial and housing sectors is more likely to occur following the U.S. government's move to bail out mortgage giants Fannie Mae and Freddie Mac. The Dow Jones industrials gained nearly 300 points.

The announcement Sunday that the Treasury Department was seizing control of the companies, which own or back about half the nation's mortgage debt, brushed aside investors' long-simmering worries that the pair would be felled by a spike in bad mortgage debt.

Investors were hoping that the plan to inject up to $100 billion in each of the government-chartered mortgage financiers could not only help lower mortgage rates but perhaps help buoy the overall economy. The move could help banks feel more open to write new mortgages and to refinance existing mortgages at lower rates, offering a possible lifeline to consumers struggling with increasing payments.

The move appeared to have an immediate soothing effect on mortgage rates. The national average interest rate for a 30-year fixed-rate mortgage dropped 0.3 percentage point to 6.04 on Monday, according to financial publisher HSH Associates.

But the government's steadying hand for two institutions that many Wall Street observers had said were simply too big to let fail isn't likely to alleviate troubles for homeowners who have fallen far behind on their mortgages.

Dave Rovelli, managing director of U.S. equity trading at Canaccord Adams in New York, said that while the plan boosts confidence in sectors like financials and homebuilders, it doesn't immediately alleviate worries about other areas of the economy. Still, he said the move was far more welcome than a collapse of Fannie Mae or Freddie Mac.

"It saves Armageddon from happening," he said. "If you think about it, this helps the financials, this helps the housing market. Tech took a huge hit last week. Does this really affect tech? I don't think so."

At the close, the Dow Jones industrial average rose 290.43, or 2.58 percent, to 11,510.74 after being up nearly 350 points in the early going.

Broader stock indicators were also higher. The Standard & Poor's 500 index advanced 25.48, or 2.05 percent, to 1,267.79, and the Nasdaq composite index added 13.88, or 0.62 percent, to 2,269.76.

Bond prices pulled back Monday. The yield on the benchmark 10-year Treasury note, which moves opposite its price, rose to 3.71 percent from 3.69 percent late Friday. The dollar was higher against other major currencies, while gold prices rose.

Common shares of Fannie Mae and Freddie Mac will be made virtually worthless by the plan, which will dilute the stock. But the companies' shares had already suffered huge declines in the last year, so many shareholders have already endured the majority of their losses.

Fannie Mae shares plunged $6.34, or 90.1 percent, to 70 cents, while Freddie Mac fell $4.21, or 83 percent, to 89 cents.