Stocks rallied on Thursday, led by strong gains in tech and energy shares, as Wall Street cheered the possibility that the Federal Reserve will cut interest rates next month.
The S&P 500 surged 1% to 2,954.18, a record close. The broad index also hit an intraday record of 2,958.06. The Dow Jones Industrial Average closed 249.17 points higher at 26,753.17. The Nasdaq Composite gained 0.8% to end the day at 8,051.34.
The yield on the 10-year Treasury fell below 2% for the first time since November 2016. Investors cheered the decline in the benchmark for mortgage rates and corporate bonds.
The energy sector rose more than 2% to lead all 11 S&P 500 sectors higher as oil prices jumped. Tech gained 1.4% after shares of Oracle surged more than 8% on stronger-than-forecast earnings. General Electric's 2.8% rise pushed the industrials sector up more than 1.6% on the day.
"Markets are based on numbers and perception. If the perception is rates are getting cut, that's going to drive markets higher," said Kathy Entwistle, senior vice president of wealth management at UBS. "UBS' stance up until yesterday was we wouldn't see any rate cuts this year. Now we see a much larger chance of a 50-basis-point cut."
The Fed said Wednesday it stands ready to battle growing global and domestic economic risks as they took stock of intensifying trade tensions and growing concerns about inflation. Most Fed policymakers slashed their rate outlook for the rest of the calendar year by approximately half a percentage point in the previous session, while Chairman Jerome Powell said others agree the case for lower rates is building.
Policymakers also dropped "patient" from the Fed's statement and acknowledged that inflation is "running below" its 2% objective.
Market participants viewed the overall tone from the U.S. central bank as more dovish than expected. Traders are now pricing in a 100% chance of a rate cut next month, according to the CME FedWatch tool.
With Thursday's gains, the market has now erased the steep losses recorded by the major indexes in May, which were sparked by trade fears. The S&P 500 and Dow both fell more than 6% while the Nasdaq lost 7.9% last month. The three indexes were up more than 7% for June.
China and the U.S. hiked tariffs on billions of dollars worth of their goods in May. Stocks turned around this month as traders bet the rising trade tensions, coupled with weaker economic data, would lead the Fed to ease its monetary policy stance.
The Fed's message on Wednesday sent the 10-year Treasury yield to as low as 1.974% before ending the day around 2.02%. The yield stood at 2.8% in January.
"The FOMC reinforced the market's conviction," said Steve Blitz, chief U.S. economist at TS Lombard, in a note. "Barring a dramatic turnaround in the data, the next move is a cut - perhaps even a 50bp reduction."
The dollar also took a hit against other major currencies. The dollar index dropped 0.5% to 96.65, led by a 0.6% slide in the euro. The yen and Canadian dollar also rose against the U.S. currency.
Energy shares got a boost from higher oil prices. The Energy Select Sector SPDR Fund (XLE) climbed 2.2% as shares of Exxon Mobil gained 1.7%. Oil prices surged 5.4% after a U.S. official said a drone was shot down over Iranian airspace.
Meanwhile, Slack shares surged more than 40% in their first day of trading. The stock closed above $38 after setting a reference price of $26.
— CNBC's Sam Meredith contributed to this report.