Stocks finished higher Thursday as optimism that the United States and Mexico can work out a deal before costly tariffs kick in next week helped power the market to its third straight gain.
A modest rally gained strength in the final hour of trading after Bloomberg reported the United States was considering delaying a 5 percent tariff on Mexican goods that is set to go into effect on Monday.
The report came as the two countries held a second day of trade talks. Both sides claimed to be making progress, but President Donald Trump insisted earlier in the day that a "lot of progress" had to be made before he would call off the tariffs.
Investors have been anxious about escalating U.S. trade disputes with key trading partners, primarily China. Worries that the trade conflicts will drag on, stifling economic growth and hurting corporate profits, drove a monthlong sell-off in May. That derailed a market run that culminated with the benchmark S&P 500 setting an all-time high on April 30.
Stocks gave up more ground on Monday, but the market has bounced back and is on track to end the first week of June with solid gains.
"History says as a result of such a good start to the year, don't be surprised that May is down, " said Sam Stovall, chief investment strategist at CFRA. "Yet, after a down May, we tend to get a reflex rally in June 100 percent of the time."
The S&P 500 index gained 0.6 percent to end at 2,843.49. The Dow Jones Industrial Average rose 181.09 points, or 0.7 percent, to 25,720.66. The Nasdaq composite reversed an early slide, adding 0.5 percent, to close at 7,615.55.