Wednesday’s trading reflected both relief and reluctance. Hopes that the war with Iran could eventually pause helped lift major indexes on Wall Street, even as the market continued to swing rapidly as uncertainty over the conflict persisted. The S&P 500 rose 0.5% and the Nasdaq composite gained 0.8%, but the moves were described as shaky after the index briefly neared erasing its morning gains.

The S&P 500’s jump topped out at 1.2% earlier in the session, according to the AP account, before reversing toward the end of the day. The Dow Jones Industrial Average added 305 points, or 0.7%, and finished higher alongside broad gains in U.S. equities. AP reported that financial markets have seen sharp reversals during the three-plus weeks since the war began, with trading that has flipped “hour to hour” on changing expectations.

The optimism appeared tied to a U.S. move described by AP as a plan to pause the war to Iran. At the same time, AP highlighted that the signals from Tehran did not suggest an immediate diplomatic breakthrough: Iran’s foreign minister, Abbas Araghchi, told Iranian state TV in an interview that his government had not engaged in talks to end the war and that it “do[es] not plan on any negotiations.”

Markets also tracked developments tied to the region’s security situation. AP said Iran launched more attacks on Israel and Gulf Arab countries, including an assault that sparked a huge fire at Kuwait International Airport, while Iran also came under attack. AP added that the U.S. military deployed paratroopers and more Marines to the region.

Oil and rates activity pointed to investors weighing the potential impact of calmer conditions against the risk of renewed escalation. Brent crude delivered in June fell 3% to settle at $97.26 a barrel, reflecting expectations that a cooldown could allow oil and natural gas to flow more freely from the Persian Gulf. AP said many oil tankers were stuck outside the Strait of Hormuz off Iran’s coast, with the blockage having pushed Brent to nearly $120 a barrel at times.

In the bond market, AP reported that Treasury yields eased, a move that can reduce pressure on borrowing costs. The 10-year Treasury yield fell to 4.32% from 4.39% late Tuesday, though it remained well above its 3.97% level from just before the war. AP also said gold, which had been among the investment world’s worst performers through the war, rose—climbing 3.4% to settle at $4,552.30 per ounce after having briefly moved toward $5,400 earlier in the month.

Not every major move in the market was tied directly to the war. AP reported company-specific drivers alongside the macro backdrop: Arm Holdings surged 16.4% after announcing a suite of chips for data centers and artificial intelligence. Robinhood Markets rallied 5% after its board authorized a program to send up to $1.5 billion to shareholders through share buybacks, while Terns Pharmaceuticals gained 5.7% after Merck said it would buy the oncology company in an all-cash deal valued at $6.7 billion.

On the decline, AP said On Holding dropped 11.2% after it said its chief executive officer, Martin Hoffmann, was stepping down. In Hong Kong, Pop Mart International Group fell 22.5% after reporting profit and revenue growth that was described as failing to meet analysts’ expectations. AP also reported that the stock prices for the parent companies of YouTube and Instagram held relatively steady after a jury found them liable in a first-of-its-kind lawsuit aimed at holding social media platforms responsible for harm to children: Alphabet added 0.2% and Meta Platforms rose 0.3%.

By the close, AP reported that the S&P 500 rose 35.53 points to 6,591.90, the Dow Jones Industrial Average gained 305.43 to 46,429.49, and the Nasdaq composite climbed 167.93 to 21,929.83.