NEW YORK >> The U.S. stock market ran up to the edge of another record Thursday.

The S&P 500 climbed 0.8% and is sitting just 0.05% below its all-time closing high, set in February. It briefly topped the mark during the afternoon in the latest milestone for the index at the heart of many 401(k) accounts, which had dropped roughly 20% below its record during the spring on worries about President Donald Trump’s tariffs.

The Dow Jones Industrial Average rallied 404 points, or 0.9%, and the Nasdaq composite gained 1%.

McCormick, seller of cooking spices, helped lead the way and jumped 5.3% after delivering a better-than-expected profit report. The company also gave a forecast for profit over its full fiscal year that topped analysts’ expectations, including planned efforts to offset increased costs caused by tariffs.

Over the longer term, it’s been big technology stocks that have led the market for years and since the S&P 500 hit a bottom in April.

Chip company Nvidia, the poster child of the frenzy around artificial-intelligence technology, added 0.5%. It’s the most valuable company in the U.S. stock market after rushing 61% higher since April 8, towering over the S&P 500’s gain of 23%. Another AI darling, Super Micro Computer, rose 5.7% to bring its gain since April 8 to 55%.

Micron Technology, which sells computer memory and data storage, swung between gains and losses after reporting stronger profit and revenue for the latest quarter than analysts expected. CEO Sanjay Mehrotra said it’s seeing growing AI-driven memory demand, and the company gave a forecast for profit in the current quarter that topped analysts’ expectations. Its stock ended the day down 1%.

All told, the S&P 500 rose 48.86 points to 6,141.02. The Dow Jones Industrial Average rose 404.41 to 43,386.84, and the Nasdaq composite gained 194.36 to 20,167.91.

Wall Street’s worries about Trump’s tariffs have receded since the president shocked the world in April with stiff proposed levies, but they have not disappeared. The wait is still on to see how big the tariffs will ultimately be, how much they will hurt the economy and how much they will push up inflation.

The economy so far seems to be holding up OK, although slowing, and more reports arrived Thursday bolstering that. One said that orders for washing machines and other manufactured goods that last at least three years grew by more last month than economists expected. A second said fewer U.S. workers filed for unemployment benefits last week, a potential signal of fewer layoffs.