NEW YORK – BP’s agreement to put $20 billion into a fund for victims of the Gulf of Mexico oil spill lifted the stock market off its lows and sent the major indexes to a narrowly mixed finish.

The oil company also said Wednesday it has canceled a dividend payment totaling about $2.6 billion that was scheduled for June 21. It also won’t declare a dividend for the second and third quarters.

Investors saw the news as an end to the uncertainty about BP’s stability, and that helped steady the overall market. The Dow Jones industrial average rose about 4 points, while the Standard & Poor’s 500 index fell less than a point and the Nasdaq composite index was virtually unchanged.

BP’s plans to place $20 billion in a fund to compensate victims were announced after a meeting between BP executives and President Obama at the White House. Traders had been questioning how BP will handle the mounting costs of the spill, which began April 20 when a rig operated by BP exploded.

“One source of uncertainty has been at least partially resolved,” said Brian Gendreau, a market strategist with Financial Network Investment Corp.

The market began the day by falling on news that home construction and applications for building permits slumped in May following the end of a homebuyer tax credit. Meanwhile, FedEx Corp. released a disappointing profit forecast for the fiscal year that began June 1, and that raised more questions about the economic recovery. The package delivery firm is seen as a barometer of the economy because shipping demand tends to increase as business conditions improve. The stock fell almost 6 percent.

The Commerce Department’s report on housing raised concerns that weaker demand for homes will hurt an economic rebound. Construction of homes and apartments fell 10 percent from a month earlier to an annual rate of 593,000, well below the 650,000 economists had forecast. A 17 percent drop in construction of single-family homes was the largest since January 1991.

Applications for building permits fell 5.9 percent to the lowest level in a year. Analysts had forecast an increase. Demand for permits is an indicator of future homebuilding activity. The weaker-than-expected numbers come after a homebuyer tax credit expired in April.

Kevin Smith, a housing market analyst at Chapdelaine Credit Partners in New York, said the drop in the home construction and permit numbers extends a string of choppy readings since October, and that it’s too soon to tell how housing will hold up. He noted that the previous month had been the best in more than two years.