Some sharp reversals kept financial markets unsteady on Thursday, as oil prices rose and U.S. stock indexes finished mixed.

The S&P 500 fell 0.5% for a second straight loss after setting its all-time high. The Dow Jones industrial average added 51 points, or 0.1%, and the Nasdaq composite fell 1.3% as technology stocks took particularly hard hits.

Stocks felt pressure from a 4.1% rise in the price for a barrel of Brent crude oil, the international standard, to $104.28.

The 10-year Treasury yield initially rose with oil prices, going from 5.28% late Wednesday to 5.35% early Thursday morning. But it then fell all the way back to 5.23%.

It dropped after the U.S. government said that it sold $22 billion in 30-year Treasury bonds at an auction with a high yield of less than 5.62%. That helped bring the 30-year Treasury yield down to 5.60% from 5.73% in the morning, which is a notable move for the bond market.

On Wall Street, the ease in Treasury yields helped the majority of U.S. stocks rise, including two out of every three in the S&P 500 index.

PepsiCo climbed 3.7% after the snack and drink company reported stronger profit and revenue for the latest quarter than analysts expected, thanks in part to strength outside of North America.

Nvidia, the chip company that’s ridden the tidal wave of demand created by artificial-intelligence technology, fell 2.9%. Because it’s the largest stock by value on Wall Street, it was the heaviest weight on the S&P 500 even though other stocks had larger losses.

That included drops for other AI-related stocks, including Broadcom’s 4.3% fall and Micron Technology’s 4.8% slide.

The losses came even though a bellwether for the chip industry, Taiwan Semiconductor Manufacturing Co., reported growth for September that suggested its revenue for the latest quarter was strong enough to top analysts’ expectations. TSMC’s stock that trades in the United States fell 3%.

AI stocks are under heavy pressure to report big growth to justify how high their stock prices have soared in recent years because of the AI frenzy.

All told, the S&P 500 fell 36.41 points to 7,765.36. The Dow added 51.77 to 51,231.64, and the Nasdaq composite slid 345.35 to 27,193.34.

— Associated Press