Stock indexes held steady Thursday after the price of oil halted its slide, at least for now.

Energy stocks fell again, but not by nearly as much as earlier in the week, after crude rose for the first time in four days. Big gains for health care stocks also helped to offset losses for financial companies and other areas of the market, leaving indexes close to flat.

advertisement | advertise on newsday

The Standard & Poor’s 500 index edged down by 1.11 points, or less than 0.1 percent, to 2,434.50. The Dow Jones industrial average dipped 12.74, or 0.1 percent, to 21,397.29, and the Nasdaq composite index rose 2.73 points, or less than 0.1 percent, to 6,236.69.

Markets this week have been dominated by oil’s tumbling price and worries about how much it will affect the broader market. Benchmark U.S. crude on Thursday rebounded a bit, rising 21 cents to settle at $42.74 per barrel.

Energy stocks in the S&P 500 dipped by 0.1 percent.

Health care stocks have been shooting higher this week even as the rest of the market struggled. Health care stocks in the S&P 500 jumped 1.1 percent, by far the biggest gain among the 11 sectors that make up the index, after the Senate unveiled its proposal to revamp how Americans get medical care.

The sector is up 3.7 percent for the week when the overall index is up just 0.1 percent.