Stocks rose on Thursday on the back of strong gains in Disney and energy shares, building on this month's sharp rally.
The Dow Jones Industrial Average climbed 101.94 points to 26,106.77 as Disney shares outperformed. The S&P 500 gained 0.4% to close at 2,891.64, led by the energy sector. The Nasdaq Composite advanced 0.6% to 7,837.13.
Disney shares contributed to the gains, rising 4.4% after an analyst at Morgan Stanley raised his price target on the stock to $160 per share from $135. The analyst cited the company's new streaming service, noting it could give its global subscriber numbers a boost.
The Energy Select Sector SPDR Fund (XLE) jumped 1.2% as oil prices surged. Hess and Phillips 66 were among the best performers within the fund, rising more than 2% each.
The major indexes posted small losses in each of the previous two sessions as a rally to start off June took a pause. The major indexes were all up more than 4% for the month, however, after notching sharp losses in May.
"Markets yet again showed some minor weakness [on Wednesday], but yet failed to decline sufficiently to think a top had been put in," Mark Newton, managing member at Newton Advisors, said in a note. These declines are "inconclusive proof of anything more than just a minor stalling."
Still, lingering trade tensions kept investors on edge. Expectations that trade officials from the U.S. and China will clinch a deal on the sidelines of a G-20 meeting in Osaka on June 28-29 have been fading in recent days.
President Donald Trump, who has said he still has plans to meet with Chinese President Xi Jinping later this month, has repeatedly threatened to escalate an already months-long trade war by putting tariffs on almost all of the remaining Chinese imports that are not already impacted by U.S. charges.
Oil prices, meanwhile, got a boost after two oil tankers were attacked in the Gulf of Oman. The Trump administration blamed the attacks on Iran. U.S. crude prices settled 2.2% higher at $52.22 per barrel. The jump comes a day after oil slipped to its lowest level in five months amid continued increases in U.S. crude stockpiles and concerns about lower demand growth.
"This will be the third time we manage to hold above that $50 level," said Peter Cardillo, chief market economist at Spartan Capital Securities. "I don't think we're ready to get back to $65 yet, because of softenss in the global economy, but I do think we can avoid dropping below $50. Look for oil to trade in a range between $50 and $55 over the next few weeks."
—CNBC's Sam Meredith contributed to this report.