NEW YORK (Reuters) - World stock markets gained back some ground on Wednesday as investors took heart from measures to curb the spread of a flu-like virus from China, while oil prices tumbled on a forecast for a market surplus.

Worries about contagion of the coronavirus and its effect on the global economy, particularly as millions in China travel for upcoming Lunar New Year festivities, had knocked the world’s top equity markets off record peaks.

Deaths from the coronavirus rose to 17 on Wednesday, with more than 540 cases confirmed. Cases of the previously unknown virus have emerged as far away as the United States.

The outbreak revived memories of the Severe Acute Respiratory Syndrome (SARS) epidemic in 2002-03, a virus outbreak that killed nearly 800 people worldwide and hit Hong Kong’s economy particularly hard.

But China’s response to the coronavirus outbreak, including some travel restrictions and regular updates by the government, reassured some investors.

“The call here is not that the virus is done or nipped in the bud by any means,” said Kay Van-Petersen, global macro strategist at Saxo Capital Markets. “But there have been no big further reported outbreaks, and the response from the Chinese authorities has been very, very positive.”

On Wall Street, the benchmark S&P 500 stock index ended nominally higher after touching a record earlier in the session.

Among currencies, the safe-haven Japanese yen JPY= and the Swiss franc CHF= were little changed against the dollar as worries over the virus abated.

China’s coronavirus had some lingering effects on oil markets. Concerns of dropping demand, along with a forecast of a market surplus from the International Energy Agency, pushed down crude prices.

FILE PHOTO: Traders work on the floor at the New York Stock Exchange (NYSE) in New York, U.S., January 21, 2020. REUTERS/Brendan McDermid/File Photo

Brent crude LCOc1 ended down $1.38, or 2.1%, at $63.21 while U.S. crude CLc1 fell $1.64, or 2.8%, to settle at $56.74.

The Dow Jones Industrial Average .DJI fell 9.77 points, or 0.03%, to 29,186.27, the S&P 500 .SPX gained 0.96 points, or 0.03%, to 3,321.75, and the Nasdaq Composite .IXIC added 12.96 points, or 0.14%, to 9,383.77.

U.S. 2-year, 10-year and 30-year Treasury yields were little changed. Earlier, they hit two-week lows after the Bank of Canada held interest rates steady and opened the door for possible easing amid an economic slowdown, rekindling worries about global growth.

“For Canada to sort of change its outlook fairly quickly opens up the possibility that easing could occur elsewhere too,” said Jim Vogel, senior rates strategist at FHN Financial in Memphis.

Benchmark 10-year Treasury notes US10YT=RR were little changed in price to yield 1.7691%, from 1.769% late on Tuesday. Across the Atlantic, Italian government bonds had their biggest sell-off in a month after reports the leader of the country's co-governing 5-Star movement had resigned.

The pan-European STOXX 600 equity index .STOXX lost 0.08%, and MSCI's gauge of stocks across the globe .MIWD00000PUS gained 0.10%. Emerging market stocks rose 0.58%.

The dollar index .DXY fell 0.01%, with the euro EUR= up 0.07% to $1.109.

The Japanese yen strengthened 0.01% versus the greenback at 109.88 per dollar, while sterling GBP= was last trading at $1.3135, up 0.67%.

Spot gold XAU= added 0.04% to $1,558.35 an ounce.

Graphic: Global currencies vs. dollar - here