It’s the Fed to the rescue. Again.

Stocks hit a record high on Thursday, a day after the Federal Reserve opened the door to interest rate cuts in the coming months. The signals sent by the central bank seemed to confirm growing certainty among investors that the Fed would lower rates this summer, in the face of a slowing global economy, downbeat signals from financial markets and uncertainty related to the United States-China trade war.

The S&P 500 closed up 1 percent, at 2,954.18, eclipsing the previous high-water mark for the benchmark index of American shares that was reached on April 30.

The market is now up more than 7 percent this month, a rally led by shares of materials, technology and consumer discretionary companies.

June’s bounce has repaired all the damage done during an ugly May, a slump set off in part when talks between China and the United States publicly fell apart in a storm of tweets, recriminations and the imposition of new tariffs. And the sell-off was accompanied by other indications that investors were betting on a darkening outlook for the global economy: tumbling oil prices and falling bond yields.