Energy companies led a broad rally in U.S. stocks Monday as investors shrugged off another slide in crude oil prices.

The gain nudged the Dow Jones industrial average slightly above the 18,000-point mark for the first time since last summer, while the Standard & Poor’s 500 index rose to the highest level in a year.

The market had been headed lower early on following news that representatives from several major oil-producing nations meeting over the weekend in Doha, Qatar, failed to hammer out a deal to cut output.

Beyond the volatile oil market, investors had their eye on the latest company earnings, which have been mostly encouraging so far, said Sean Lynch, co-head of global equity strategy at Wells Fargo Investment Institute.

“We’re seeing broad-based gains across all the sectors,” Lynch said.

The Dow climbed 106.70 points, or 0.6 percent, to close at 18,004.16. The last time the average was above 18,000 points was on July 20.

advertisement | advertise on newsday

The S&P 500 index added 13.61 points, or 0.7 percent, to 2,094.34. That’s the highest level since April 14 last year.

The Nasdaq composite index gained 21.80 points, or 0.4 percent, to 4,960.02.