U.S. stock indexes nudged higher Friday after energy companies clawed back some of their sharp losses from earlier in the week.
After meandering up and down through the day, the Standard & Poor's 500 rose 3.80 points, or 0.2%, to end at 2,438.30. The Dow Jones industrial average slipped 2.53 points, or less than 0.1%, to 21,394.76, and the Nasdaq composite gained 28.56, or 0.5%, to 6,265.25. More than twice as many stocks rose than fell on the New York Stock Exchange.
Energy stocks led the way, and those in the S&P 500 climbed 0.8% for the largest gain of the 11 sectors that make up the index.
Rising prices for oil and natural gas drove the gains. Benchmark U.S. crude added 27 cents to settle at $43.01 per barrel. Brent crude, the international standard, gained 32 cents to $45.54 and natural gas rose 4 cents, or 1.2%, to $2.93 per 1,000 cubic feet.
EQT, a producer of natural gas and crude, had the day's biggest gain in the S&P 500 and jumped $4.16, or 8%, to $56.19. Cabot Oil & Gas climbed 88 cents, or 3.8%, to $23.74.
Friday's gains, though, weren't enough to keep energy stocks from closing out their worst week in nine months. They had earlier sunk four straight days as oil dropped to its lowest price since August on expectations that the world has more crude supplies than users need. Energy stocks lost 2.9% over the course of the week.
What kept broad indexes afloat for the week were big gains for healthcare and technology stocks. The S&P 500 rose 0.2% for the week.
Healthcare stocks climbed as the Senate unveiled its proposal to revamp how Americans get medical care. Technology companies, meanwhile, are forecast to report strong growth in the upcoming earnings season, and Oracle's profit report on Wednesday sailed past analysts' expectations.
Friday's biggest decliner in the S&P 500 was Bed Bath & Beyond, which reported weaker earnings for the latest quarter than analysts expected. The retailer's revenue also fell short of Wall Street's forecasts. Its shares fell $4.09, or 12.1%, to $29.65.
Bond prices were little changed, and yields held relatively steady. The 10-year Treasury yield dipped to 2.14% from 2.15% late Thursday. The two-year yield was flat at 1.34%, and the 30-year yield held at 2.72%.
The dollar slipped to 111.26 Japanese yen from 111.34 yen late Thursday. The euro rose to $1.1199 from $1.1147, and the British pound rose to $1.2722 from $1.2672.
In European stock markets, France's CAC 40 fell 0.3%, Germany's DAX lost 0.5% and the FTSE 100 slipped 0.2%.
A monthly survey revealed that a measure of economic strength in the 19-country Eurozone slipped to a five-month low in June, which was below market expectations. However, the IHS Markit composite purchasing managers' index indicated that job creation and business confidence were still robust.
Japan's Nikkei 225 index added 0.1%, South Korea's Kospi rose 0.3% and the Hang Seng in Hong Kong was close to flat.
In the commodities market, gold rose $7 to settle at $1,256.40 ounce. Silver added 14 cents to $16.65 per ounce, and copper rose 3 cents to $2.62 per pound.
Heating oil was close to flat at $1.37 per gallon and wholesale gasoline was little changed at $1.43 per gallon.
2:25 p.m.: This article was updated after the close of markets.
10:30 a.m.: This article was updated to include more recent market information.