STORY: U.S. stocks rallied on Tuesday with the Dow and S&P 500 gaining more than 1% each and the Nasdaq climbing nearly one-and-a-half percent.

Tuesday marked the second straight session of solid gains following U.S. missile strikes on Iran's key nuclear facilities, with the S&P ending near its all-time closing high reached on February 19.

Meanwhile, the Nasdaq 100, a subset of the Nasdaq Composite, hit an all-time closing high.

A fragile ceasefire between Israel and Iran boosted investor sentiment, said Rob Haworth, senior investment strategy director at U.S. Bank Asset Management Group.

"Stocks today are really relieved that there is a ceasefire out of Israel and Iran. And we're starting to see that relief rally push through. And that's in spite of a weaker consumer sentiment. Consumer confidence numbers came in a little softer today, but really the market is getting that relief rally. And it's interesting, we're seeing it in places other than the U.S., with foreign stocks having a strong day as well. So it's nice to have a little easing in those Middle Eastern tensions."

On the economic front, pessimism over the jobs market, as reflected in the consumer confidence data for June, fell to its lowest level in more than four years.

Investors also parsed comments on Capitol Hill from Federal Reserve Chair Jerome Powell, who reiterated his view that rate cuts can wait until the inflationary effects of tariffs are better known.

Stocks on the move Tuesday included crypto exchange Coinbase Global, which rose 12% after bitcoin hit a one-week high.

Shares of Broadcom touched a record high on Tuesday, closing about 4% higher, after HSBC raised the semiconductor manufacturer to "buy" from "hold."

And shares of FedEx dropped more than 5% in extended trading after the company issued a disappointing current-quarter forecast.