The S&P 500 and the Nasdaq posted record closing highs after news reports said the US and Iran had reached a draft agreement to extend their ceasefire for 60 days while investors also digested key inflation data.
The Dow Jones Industrial Average, which was subdued during the session, eked out small gains in afternoon trade to finish at another closing high.
The agreement still needs US President Donald Trump's approval, sources told Reuters.
Iran's Tasnim news agency, meanwhile, said the text of a potential memorandum of understanding with the US has not yet been finalised or confirmed.
“Traders are on a hair trigger with the back-and-forth on deal news, and have been leaning long to avoid getting trampled by a better-than-expected outcome. The harder part is that the inflationary forces may not abate as fast as markets want,” said Jamie Cox, managing partner at Harris Financial Group.
Inflation data remains in focus
Economic data showed US inflation increased at its fastest pace in three years in April, driven by higher energy prices amid the Iran war.
Meanwhile, US GDP for the first quarter was revised lower to a 1.6 per cent annualised increase, with momentum expected to slow this quarter.
The Dow Jones Industrial Average rose 24.69 points, or 0.05 per cent, to 50,668.97, the S&P 500 gained 43.27 points, or 0.58 per cent, to 7,563.63 and the Nasdaq Composite gained 242.74 points, or 0.91 per cent, to 26,917.47.
Tech and healthcare shares move higher
The S&P 500 healthcare index posted strong gains.
Eli Lilly advanced 4.0 per cent after CVS Health said it would restore the drug maker's weight-loss injection Zepbound to its coverage and add its newly approved obesity pill Foundayo.
Tech shares also moved higher.
Microsoft gained 3.5 per cent after news website The Information reported that the company would release a new coding model next week.
Marvell Technology rose 3.0 per cent after UBS raised its target price to US$230 from US$195. The company's shares have more than doubled so far this year.
Snowflake shares soared 36 per cent after the data analytics firm lifted its annual product revenue forecast and announced a five-year AI infrastructure deal worth US$6 billion (A$8.4 billion) with Amazon Web Services.
Drone companies also rose after the Wall Street Journal reported Trump's administration was in talks to fund drone firms.
Investors continue to look through geopolitical risks
Renewed confidence in AI and earnings growth momentum have underscored the recent rally despite the Middle East tensions, which have increased inflationary expectations.
“Markets continue to look through these risks because the global economy and corporate earnings remain relatively resilient,” said Jitania Kandhari, deputy CIO, solutions and multi-assets, at Morgan Stanley Investment Management.
“Geopolitical instability could ultimately accelerate spending in areas tied to AI, including cybersecurity, defence technology, energy infrastructure and supply-chain resiliency, reinforcing the long-term investment case.”
While the S&P 500 is trading at roughly 21 to 22 times forward earnings versus a trailing 10-year average of 19.7 times, investors are less concerned because earnings expectations are rising faster than stock prices, Kandhari said.