NEW YORK (Reuters) - The dollar gained, helped by better-than-expected data in the U.S. non-manufacturing sector, and oil prices retreated on Tuesday as caution kept investors alert for developments in the U.S.-Iranian stand-off in the Middle East.

Gold prices inched higher after backing off an almost seven-year high on Monday, when risk-aversion drove demand. Stocks in Europe mostly edged higher and on Wall Street traded little changed to lower.

A U.S. drone strike in Baghdad on Friday killed Iranian military commander Qassem Soleimani, widely seen as Iran’s second-most powerful figure, in a slaying that threatens to spark regional conflict.

Tehran has vowed retaliation and French President Emmanuel Macron urged Iran to avoid any actions that could worsen Mideast tensions. Germany called for a joint European response to Iran’s decision to scrap limits imposed on its nuclear enrichment program.

MSCI’s gauge of stocks across the globe shed 0.03while the pan-European STOXX 600 index rose 0.25%.

“Earnings and the economy have taken a bit of a back seat relative to the rising tensions in the Mideast and investors are keenly focused on what might happen there next,” said Michael Arone, chief investment strategist at State Street Global Advisors in Boston.

Even amid rising geopolitical tensions, cyclical stocks have outperformed defensive shares, reflecting views that the U.S. economy remains strong and growth will re-accelerate later in the year despite the flare-up in the Middle East, he said.

“The ISM non-manufacturing number was a little bit above expectations. That would support the idea the consumer and cyclicals that benefit from the consumer are the leadership today even in a down market,” Arone said.

The Institute for Supply Management said its non-manufacturing activity index rose to 55.0 last month from 53.9 in November. A reading above 50 indicates expansion in the services sector, which accounts for more than two-thirds of U.S. economic activity.

FILE PHOTO: A trader looks at a screen at the New York Stock Exchange (NYSE) in New York, U.S., October 25, 2019. REUTERS/Brendan McDermid

The report came after an ISM survey last week showed its measure of U.S. factory activity dropped in December to its lowest since June 2009, contracting for a fifth straight month.

History suggests when a discrepancy between manufacturing and services is large, the gap will be closed with the former rebounding, Joseph LaVorgna, chief economist in the Americas at Natixis, said in a note.

Rising European and U.S. semiconductor stocks offset a decline in energy shares as Microchip Technology raised its third-quarter sales outlook. The technology index rose 1.3%, the most among European sub-sectors.

Infineon Technologies jumped 5%, helping Germany’s DAX close up 0.8%, while STMicroelectronics’s 2.5% gain lifted Italian stocks by 0.6%.

On Wall Street, the Dow Jones Industrial Average fell 119.7 points, or 0.42%, to 28,583.68 The S&P 500 lost 9.1 points, or 0.28%, to 3,237.18 and the Nasdaq Composite dropped 2.88 points, or 0.03%, to 9,068.58.

Emerging market stocks rose 0.31%.

The safe-haven Japanese yen fell from a three-month high versus the dollar and the Swiss franc pulled back from recent highs against the greenback, despite concerns about U.S.-Iranian tensions.

The dollar index rose 0.36%, with the euro down 0.44% to $1.1144. The yen weakened 0.14% versus the greenback at 108.54 per dollar.

The dollar was up 0.29% at 0.9712 franc.

Oil prices fell almost 1%, surrendering some of the gains of recent days as investors weighed the likelihood of immediate supply disruptions in the Middle East.

Brent crude fell 64 cents to settle at $68.27 a barrel. U.S. West Texas Intermediate crude settled down 57 cents at $62.70 a barrel.

Euro zone government bond yields edged up from three-week lows and yields on U.S. Treasuries were little changed.

Germany’s benchmark Bund yield was little changed at around -0.28%, having risen from more than three-week lows on Monday at -0.31%. But it remained below last week’s seven-month highs amid euphoria over the year-end stock rally.

Benchmark 10-year Treasury notes fell 4/32 in price to yield 1.8247%.

Gold prices rose. Absent aggressive rhetoric, the perceived risk to oil will diminish and reduce gold’s appeal, said Bart Melek, head of commodity strategies at TD Securities.

“The market thinks that at this point the conflict may not escalate too much,” Melek said.

Spot gold rose 0.34% to $1,571.21 an ounce. U.S. gold futures settled 0.3% higher at $1,574.30.