Stocks climbed on Wednesday, with the Nasdaq composite hitting a record, after President Trump backed away from further confrontation with Iran. A handful of upbeat corporate updates also pointed to growing signs of economic strength.

The S&P 500 shot higher shortly after Mr. Trump concluded a speech from the White House on Wednesday morning, in which he said that Iranian missile strikes on American positions in Iraq had produced no American casualties and that Iran now “appears to be standing down.”

By the end of the day, the index was up 0.5 percent, at 3,253.05, just shy of a record. The tech-heavy Nasdaq composite rose 0.7 percent to reach its new high.

Oil prices, which had spiked after the missile attacks on Tuesday night, tumbled after the televised address.