Stocks wavered on Tuesday as Wall Street assessed the growing geopolitical risks stemming from U.S.-Iran tensions along with better-than-expected data on the economy.

The Dow Jones Industrial Average closed 119.70 points lower, or 0.4% at 28,583.68. The S&P 500 pulled back 0.3% to 3,237.18. The Nasdaq Composite ended the day just below the flatline at 9,068.58.

The major averages briefly pared earlier losses after the Institute for Supply Management said its non-manufacturing index rose to 55 in December from 53.9 in November. That print is also above economist expectations.

President Donald Trump announced last week that the U.S. had killed Iran's top military commander in Baghdad, Gen. Qasem Soleimani. The president also said Sunday that he could slap sanctions on Iraq, after its parliament passed a resolution calling for the government to expel foreign troops from the country.

However, U.S. equities rose on Monday, reversing earlier losses and recovering some of Friday's steep decline. Market players are now waiting to see if the situation will escalate with a potential retaliation from Iranian forces.

"The headlines seem to be moving more than the market right now," said Keith Lerner, chief market strategist at SunTrust Private Wealth. "I think investors have been through this a few times now." He also noted the market is in a "consolidation mode" after notching sharp gains in 2019.

The S&P 500 and Nasdaq logged their best annual performance in six years in 2019, surging 28.9% and 35.2%, respectively. The Dow also climbed more than 22% in 2019.