The net profit margin for companies in the S&P 500 rose to 14.8% in the first quarter, the highest since FactSet began tracking the metric in 2009, surpassing the previous peak of 13.2% set just one quarter earlier, according to data from FactSet.

The margin expansion is not confined to a single industry. Financial services, industrials, and other sectors reported net margins above their five-year averages in the first quarter, according to the data provider. Nancy Tengler, chief executive of Laffer Tengler Investments, described the current period as “a productivity-driven environment, much like the 90s were, and productivity is spreading across sectors.” She attributed the gains to advances in artificial intelligence and other technologies.

The technology sector remains the leading contributor. Excluding tech, the S&P 500 would have posted a net profit margin of 12.4% for the first quarter, according to John Butters, senior earnings analyst at FactSet. Within AI, the picture is mixed: chip makers and infrastructure providers are reporting expanding margins, while some hyperscale cloud companies face margin pressure from hundreds of billions in capital spending.

The S&P 500’s earnings growth rate surged to 28.8% in the first quarter, the highest since the fourth quarter of 2021, FactSet reported. Analysts expect second-quarter net profit margins of 14.2%, ahead of the year-ago figure of 12.9% and the five-year average of 12.3%. The second-quarter results will be a key test of how profit margins held up against inflationary pressure from the conflict in the Middle East and heavy spending on the AI infrastructure buildout, according to analysts cited by the Journal.

Some companies have responded by raising prices. Apple Chief Executive Tim Cook said in an interview with The Wall Street Journal that the company’s price increases on its products were intended to offset the surging costs of memory and storage chips.

Valuation remains a concern for some investors, though corporate earnings have so far supported elevated stock prices. The S&P 500 is trading at about 20 times its projected earnings over the next 12 months, above the 10-year average of 19, according to FactSet.

Matt Miskin, co-chief investment strategist at Manulife John Hancock Investments, warned that the technology-driven gains could reverse quickly. “The problem is this can whipsaw pretty fast, and if the dynamics change on pricing, on the insatiable demand for semiconductors, in particular, this reversal could be significant,” Miskin said.

Profit margins may also face pressure from tighter financial conditions and elevated interest rates. After the Federal Reserve signaled a continued commitment to price stability under Chairman Kevin Warsh at its June meeting, traders increased the probability of an interest-rate increase by the end of the year, the Journal reported.

OpenAI is considering slashing the prices it charges users to win customers from rival Anthropic, the Journal reported. A pricing war in the AI sector could affect margins at companies that supply the technology.