U.S. markets notched solid gains Thursday on signs of impending rate cuts from the Federal Reserve, with the Standard & Poor’s 500 setting a new all-time high and putting the index on track for its best June since 1955.

The S&P 500 beat its own record shortly after the markets opened, then climbed further to close at 2,954.18. The Dow Jones industrial average also surged, climbing nearly 250 points and coming within 1 percent of its own record.

The power run comes on the heels of the markets’ worst May since 2010, as investors struggled to parse the risks from President Trump’s multi-front trade conflicts. Though the Fed board wrapped up meetings this week without announcing a rate cut, they indicated a willingness to do more to shore up the economy against any slowdowns tied to the trade war. Nearly half of the Fed leaders are calling for rate cuts before year’s end — a dramatic shift from March, when no one was talking about the possibility.

“The case for somewhat more accommodative policy has strengthened,” Fed Chair Jerome H. Powell said Wednesday. “It’s really trade developments and concerns about global growth that are on our minds . . . Risks seem to have grown."

After Powell’s comments, the U.S. 10-year Treasury yield slipped as low as 1.97 percent, the first time the benchmark has fallen below 2 percent since November 2016.

U.S. markets held steady and remained in positive territory this week after Trump announced he would be meeting with Chinese leader Xi Jinping at the upcoming G-20 summit in Japan, giving investors hope for a truce in the U.S.-China trade war. Economists and business leaders have been pressing for de-escalation over worries that a protracted fight might weaken the economy, both domestically and globally.

“Even as there is skepticism about any likelihood of meaningful breakthroughs on trade negotiations, the fact that Pres. Trump has confirmed that he will meet with Chinese Pres. Xi next week is giving some optimism that a potential trade deal with China is to be reached in the near future,” Ivan Feinseth, chief investment officer at Tigress Financial Partners, wrote in a note to investors Thursday.

Crude oil prices soared after Iran announced it had shot down a U.S. military drone, caused investors to fear for future oil supplies. Tensions have been rising since last week, when U.S. authorities blamed Iran for an attack on two oil tankers near the Strait of Hormuz. Oil prices rose 6 percent, settling near $56 a barrel.

Popular workplace messaging company Slack beat expectations with its debut on the New York Stock Exchange, with trading starting at $38.50, well above its reference price of $26. It jumped as high as $42 before closing at $38.62, giving it a $19.5 billion valuation.

The company eschewed the typical IPO process in favor of a direct listing, which allows company investors and other stakeholders to sell directly to the market without issuing new shares.

“The big thing for us was in the traditional IPO, it’s the company that’s offering shares, you might raise, you know, a billion dollars or something like that,” Slack chief executive Stewart Butterfield said Thursday during an interview on CNBC. “When you raise a billion dollars, you dilute existing shareholders, by issuing new shares. So, we are not doing that. We’re just opening it up for trading.”

Spotify, the only other major company to go public with a direct listing, debuted in April 2018 with a reference price of $132. Its stock has climbed about 15 percent since.