Concerns that a resurgence in the COVID-19 pandemic could lead governments to again shut down economies spurred profit-taking, particularly after the recent stock rally.

Pandemic uncertainties were compounded by news on Tuesday of halts to separate trials for a COVID-19 vaccine and a treatment, tempering a brief stock boost from U.S. investment bank Goldman Sachs Group's strong earnings report.

Remarks by U.S. Treasury Secretary Steven Mnuchin that a deal for more fiscal stimulus would not likely be reached before the Nov. 3 elections also capped gains in shares.

Major U.S. stock indexes gave up early gains and the S&P 500 closed down 23 points, or 0.7%, at 3,488.67. The Dow Jones Industrial Average dropped 166 points, or 0.6%, to 28,514.00, while the Nasdaq Composite shed 95 points, or 0.8%, at 11,768.73.

"The fear is we are headed back towards a lockdown, not a re-opening of economies," said Tim Ghriskey, chief investment strategist at Inverness Counsel in New York.

France declared a public health state of emergency on Wednesday, while Italy, Russia and Poland all reported their highest-ever daily tallies of new infections.

With COVID-19 cases surging, some European nations are closing schools, canceling surgeries and enlisting student medics as overwhelmed authorities braced for a repeat of the nightmare scenario seen earlier this year.

The pan-European STOXX 600 ended barely changed at 370.62, while markets in Frankfurt and Paris were flat and down 0.1%, respectively. London, buffeted in part by Brexit angst, dropped 0.6%. World stocks <.MIWD00000PUS> slipped 0.3% but stayed within sight of the all-time high struck on Sept. 3.

Asian stocks were also lackluster. MSCI's broadest index of Asia-Pacific shares outside of Japan <.MIAPJ0000PUS> ended a seven-day rally and slipped 0.11%, a day after hitting a 2-1/2 year high of 588.76. Chinese shares <.CSI300> closed down 0.7%.

The price of gold climbed more than 1% before narrowing gains to $1,903.15 an ounce.

Government bonds also benefited from investor caution. German bund yields, which move inversely to prices, hit their lowest since May. The 10-year U.S. Treasury yield dipped to 0.7256%, and the yield curve - the gap between two- and 10-year yields - flattened a touch on news that more U.S. fiscal stimulus was unlikely before the Nov. 3 election.

The U.S. dollar softened after pulling its best day in three weeks on Tuesday. The dollar index <=USD>, which measures the greenback against a basket of six major currencies, fell 0.2% to 93.38.

In a sign that some investors preferred traditionally safer assets for now, the yen gained 0.4% to hit a near two-week high of 105.11 against the dollar.

The euro was little changed at $1.1753 after hitting a nine-day low of $1.1718, while sterling held above $1.30, helped by news of "some progress" in British-European Union trade talks this week. By early evening, the pound was up 0.7% at $1.3031.

A weaker dollar, which makes oil cheaper for holders of other currencies, supported oil prices.

Brent crude gained 92 cents, or 2.2%, to $43.37 a barrel, while U.S. West Texas Intermediate added 87 cents, or 2.2%, to $41.07.

(Reporting by Koh Gui Qing; Editing by Lisa Shumaker, Leslie Adler and Richard Chang)

By Koh Gui Qing