The posted a four-day losing streak on Wednesday — its longest slide since early May — as investors braced for a key meeting between President Donald Trump and Chinese President Xi Jinping later this week.
The broad index closed 0.1% lower at 2,913.78, giving up gains from earlier the day. The Dow Jones Industrial Average fell 11.40 points to 26,536.82 after rising more than 100 points to start off the session.
The Nasdaq Composite outperformed, rising 0.3% to 7,909.97 as Micron shares led semiconductor stocks higher. The VanEck Vector Semiconductor ETF (SMH) climbed nearly 3% as Micron surged more than 13%. Nvidia rose 5.1% while On Semiconductor climbed 4.2%.
Stocks traded higher for most of Wednesday's session after Treasury Secretary Steven Mnuchin told CNBC's Hadley Gamble he thinks "there's a path" for the U.S. and China to complete a trade deal. His comment came ahead of a meeting between President Donald Trump and Chinese President Xi Jinping at the G-20 summit in Osaka, Japan later this week.
"This clearly highlights how the escalation of the trade conflict in May negatively impacted stock returns while a trade resolution will lift them back up," said Nick Raich, CEO of The Earnings Scout, in a note. However, "this is not new talk from Mnuchin."
Bloomberg News also reported, citing sources, that the U.S. was willing to suspend tariffs on $300 billion worth of Chinese goods as the two sides resume trade talks.
Trump told Fox Business that a U.S.-China trade deal was possible, but noted he is "very happy with where we are now. We're taking in a fortune, and frankly [it's] not a very good thing for China, but it is a good thing for us."
Trade talks stalled last month after the U.S. hiked tariffs on billions of dollars worth of Chinese imports. China retaliated with tariffs of its own. Those fears dissipated in June after Trump said he and Xi agreed to meet at the G-20, stoking hope of trade progress between the two countries.
"What we're probably going to hear will be choreographed. They'll probably say the meeting went well and they're going back to the negotiating table," said Art Hogan, chief market strategist at National Securities. "This is all fixable … but the problem is there is too much pageantry around all of this. Both sides need to play to their bases."
Wall Street saw its worst day of June on Tuesday on the back of comments from Federal Reserve officials. Fed Chair Jerome Powell Tuesday said the central bank is assessing whether the U.S. economy is calling for lower rates. However, Powell also said that the Fed will take a wait-and-see approach given how rapid recent economic changes have been.
Earlier on Tuesday, James Bullard, president of the St. Louis Fed, downplayed prospects of a rate cut.
Investors are betting the Fed will cut rates by at least 25 basis points in July. Those expectations helped lift the major stock indexes this month. The Dow and Nasdaq are both up more than 6% while the S&P 500 has risen 5.9% in June.
In corporate news, Micron shares shot up after the chipmaker said it could "lawfully resume" shipments to Chinese telecom giant Huawei. The stock also got a boost from better-than-expected quarterly results.
FedEx shares rose more than 2% after the company reported quarterly earnings that topped analyst expectations.
Correction: Earlier headlines were revised to correct that Mnuchin was using past tense when he described 90% progress in U.S.-China talks.
—CNBC's Silvia Amaro and Spriha Srivastava contributed to this report.