NEW YORK (AP) — U.S. stock indexes ended Tuesday nearly where they began, as interest rates let off the accelerator following their sharp rise last week. But the modest moves for indexes masked some roiling underneath.

Raw-material producers plunged on worries that inflation and weaker demand are eating into their profits. On the opposite end were technology stocks and other sectors, which recovered some of the sharp losses caused by last week’s rapid rise in interest rates.

Altogether, the crosscurrents left the S&P 500 down 4.09 points, or 0.1 percent, at 2,880.34. It had waffled between small gains and losses for most of the day, and roughly three stocks fell in the index for every two that rose.

The Dow Jones industrial average fell 56.21, or 0.2 percent, to 26,430.57, and the Nasdaq composite added 2.07, or less than 0.1 percent, to 7,738.02.

At the center of the movements were interest rates, which sway how quickly the economy grows, how expensive it is for companies and households to borrow and how high a price investors are willing to pay for stocks. The yield on the 10-year Treasury dipped to 3.20 percent from 3.22 late Friday in the first day of trading after bond markets were closed for a holiday on Monday.

The pause came after bond yields surged last week following several encouraging reports on the economy. The 10-year Treasury yield was just 3.05 percent last Tuesday, and the speed of the recent rise has been more concerning to investors than the level. If rates go high enough, they can hurt profits for companies and drive investors away from stocks and into bonds.

Tuesday’s ease in rates helped technology stocks, which have been leading the market, both on the way up for most of the past year and on the way down over the last week. Technology companies are producing some of the biggest profit growth in the market, but their stocks are also trading at relatively high prices relative to those earnings.

Tech stocks in the S&P 500 are down 3 percent so far this month, versus a 1.2 percent loss for the overall index. But the group rose 0.4 percent Tuesday as interest rates dropped.

Energy stocks did even better, benefiting from another rise in the price of oil. Energy stocks in the S&P 500 climbed 1 percent, led by a 3.3 percent rise for Pioneer Natural Resources and a 2.7 percent climb for Apache.

“We like energy right now, and we think prices aren’t likely to come down anytime soon,” said Barry James, president and portfolio manager of James Advantage Funds. “The explorers have been left behind a little bit by the refiners, and now’s their time to catch up.”

On the losing end were raw-material producers, which tumbled 3.4 percent for the sharpest loss among the 11 sectors that make up the S&P 500.

PPG, which sells paints and coatings, sank 10.1 percent to $98.56 for the biggest loss in the S&P 500 after it warned that higher costs for oil and other materials will weigh on its third-quarter results. It also said that demand is weakening in China, as well as in the United States and Europe for automotive refinish products.

Companies across the economy are scheduled to report their earnings results for the summer in the coming weeks, and expectations along Wall Street are for another strong quarter of growth. Lower taxes and a strong U.S. economy are helping profits, but investors also want to hear what companies say about their costs and how the global trade war is affecting their business.

The International Monetary Fund downgraded its forecast for global economic growth late Monday, citing higher interest rates and ongoing trade battles. The IMF said the global economy will grow 3.7 percent this year, the same as in 2017, but down from its earlier forecast of 3.9 percent. The IMF also cut its forecast for Chinese economic growth in 2019 to 6.2 percent, which would be its slowest since 1990.