NEW YORK — Shares of banking, technology and health care companies fell Wednesday after U.S. stocks had surged the day before. Oil prices hit a three-year high after President Trump tweeted that the U.S. will launch missiles at targets in Syria.

Other than energy companies, stocks were slightly lower for most of the day. Banks slipped along with interest rates while health care and technology companies gave up some of the big gains they made Tuesday. Trump said the U.S. will respond to the recent suspected chemical attack, and Saudi Arabia said it intercepted missiles fired by rebels in Yemen. Fighting in the Middle East could restrict oil supplies and push prices higher.

Simona Mocuta, senior economist for State Street Global Advisors, said it’s a challenge for investors to respond to events like possible strikes in Syria because it’s not clear what the outcomes will be.

“There is so much uncertainty about the geopolitics that it’s hard for the market even to price on a day-to-day basis,” she said.

The S&P 500 index fell 14.68 points, or 0.6 percent, to 2,642.19 after it surged 1.7 percent Tuesday. The Dow Jones industrial average slid 218.55 points, or 0.9 percent, to 24,189.45. The Nasdaq composite lost 25.27 points, or 0.4 percent, to 7,069.03. But the Russell 2000 index of smaller-company stocks rose 3.37 points, or 0.2 percent, to 1,546.80, and most of the stocks on the New York Stock Exchange finished higher.

Facebook stock continued to rise as CEO Mark Zuckerberg testified before Congress for a second day. The stock surged Tuesday afternoon at the beginning of Zuckerberg’s testimony. It rose 0.8 percent to $166.32 Wednesday after a jump of 4.5 percent Tuesday, its biggest gain in two years.

Daniel Ives, head of technology research for GBH Insights, said Facebook rallied for two reasons. One is that Zuckerberg did well in his testimony after investors had their doubts about how he would perform on Capitol Hill. The other is that Wall Street felt many members of Congress weren’t very tough on Facebook because they don’t grasp some of the relevant issues. As a result, investors grew less worried that the government will crack down on Facebook and other technology companies.

Energy companies rose as benchmark U.S. crude climbed 2 percent to $66.82 a barrel in New York. Brent crude, used to price international oils, gained 1.4 percent to $72.06 a barrel in London. Oil prices jumped more than 3 percent Tuesday as investors got more optimistic about a possible resolution to the U.S.-China trade spat.

Only subscribers are eligible to post comments. Please subscribe or to participate in the conversation. Here’s why.

Use the form below to reset your password. When you've submitted your account email, we will send an email with a reset code.