U.S. stocks closed lower Wednesday, with both the Dow and the S&P 500 suffering their biggest one-day percentage drops since September as falling oil prices and worries over the progress of a U.S. tax overhaul left investors increasingly averse to putting more money into assets seen as risky.

What did the main benchmarks do?

The Dow Jones Industrial Average DJIA, -0.87% fell 138.19 points, or 0.6%, to 23,217.28. The S&P 500 index SPX, -1.11% lost 14.25 points, or 0.6%, to 2,564.62, with nine of the 11 main sectors trading lower. Energy shares were the biggest losers on the S&P 500, falling 1.2% alongside the drop in oil prices.

Both the Dow and the S&P had their worst day since Sept. 5, falling for the fourth time in the past five sessions. The session marked the first time in 50 sessions that the S&P fell at least 0.5% in a single trading day, putting an end to its longest such streak since 1968, according to data from LPL Financial.

The Nasdaq Composite COMP, -1.07% declined 31.66 points, or 0.5%, to end at 6,706.21.

What drove markets?

A slide in oil prices again weighed on investor appetite for riskier assets. West Texas Intermediate crude US:CLZ7 fell 0.8%, to $55.26 a barrel after the American Petroleum Institute late Tuesday reported a surprising buildup in U.S. inventories of both crude oil and gasoline.

Data from the U.S. Energy Information Administration on Wednesday showed that domestic crude supplies rose by 1.9 million barrels for the week ended Nov. 10. That was contrary to the forecast for a decline of 1 million barrels from analysts surveyed by S&P Global Platts. An increase in inventories is taken as a sign of lighter demand.

Everything you need to know to invest in an ICO

Crude prices were already under pressure Tuesday, with both WTI and Brent settling at their lowest levels since Nov. 3. The move lower came after the International Energy Agency cut its global crude-demand forecasts and warned of a boom for U.S. shale-oil production.

Thomas Kee:To make money in oil, listen to prices more than news

Meanwhile, concerns over the progress of tax-cut legislation in Washington were lingering on Wednesday. The Senate Finance Committee unveiled major changes to its tax legislation late Tuesday, including a repeal of the Obamacare individual mandate. Uncertainty over the issue grew after Republican Sen. Ron Johnson said he wouldn’t vote for the plan, putting its odds of passing into further question.

Read:Here’s what happens if Obamacare mandate is repealed, as Senate is considering

What are strategists saying?

• “Now that the earnings season is wrapped up, markets are more beholden to macro data. Weakness in oil prices and skepticism about the passing of the tax bill are also weighing on sentiment,” said Karyn Cavanaugh, senior market strategist at Voya Financial.

Despite the drop on the day, major indexes remain within 1.5 percentage points of record levels.

“Any pullback at this stage should be viewed as an opportunity to buy, however. Earnings outlook for U.S. stocks, especially with the synchronized global growth environment is still good,” Cavanaugh said.

• “There have been a flurry of events that taken separately would not impact stocks but in combination are causing this weakness. While this is not a reflection of a sustained downward move, a little pullback is possible given uncertainty about the tax plan and also the Fed policy, which right now differs from market expectation,” said Shannon Saccocia, chief investment strategist at Boston Private.

What economic data are coming?

Retail sales slowed in October, rising only 0.2%, after a sharp gain in the prior month.

The consumer-price index rose 0.1% in October, held down by falling energy prices. This was in line with forecasts.

See:Why the yield curve may invert even if inflation picks up

Speaking in London early Wednesday, Chicago Fed President Charles Evans said inflation has been too low for too long and the U.S. central bank has to alter its communications with the markets to convince investors the central bank is willing to let it run hotter than the 2% target.

Boston Fed President Eric Rosengren will give a speech at Northeastern University’s economic policy forum in Boston later in the day.

Check out:MarketWatch’s Economic Calendar

Which stocks were in focus?

Shares of Boeing Co. BA, -3.81% rose 0.4% after the aircraft maker announced a deal to sell Dubai-based Flydubai up to 225 more of its 737 Max 8 planes at a list price value of $27 billion. Meanwhile, rival Airbus SE secured one of the largest aircraft deals in history with a 430-jet, $49.5 billion order.

Target Corp. TGT, +0.82% dropped 9.9% after the retailer’s fiscal third-quarter profit and sales beat expectations, but the company offered a downbeat profit outlook for the current quarter and said it expected a “highly competitive” environment for holiday sales.

Shares of SendGrid Inc. US:SEND spiked 12.5% in their trading debut. The email-marketing company priced its initial public offering higher than expected and offered more shares than originally planned.

General Electric Co. GE, -2.41% rose 2% in a partial rebound from recent weakness. The Dow component has tumbled more than 10% this week alone — it is off 42% year to date — with heavy selling after it cut its dividend.

Among the most actively traded energy stocks, Exxon Mobil Corp. XOM, -1.61% fell 1.3% while Halliburton Co. HAL, -2.49% was off 2.9%.

What are other assets doing?

European stocks SXXP, -0.66% suffered a seventh-straight loss as falling oil prices drove major energy names lower. Asian markets ADOW, -0.13% closed sharply lower across the board, also weighed by falling commodity prices. Gold futures US:GCZ7 reversed earlier gains and were $4.80 lower to $1,278.10 an ounce.