The major domestic equity indexes closed out the trading day on Tuesday virtually unchanged after recovering almost all of the day’s earlier losses. The shares of energy companies rallied after the statement by the White House that the United States would quit the Iran nuclear deal, confirming what many had already believed would happen.

In a televised speech, Trump said we would withdraw from a 2015 international agreement designed to deny Tehran the ability to build nuclear weapons, and would at the same time reinstate sanctions on Iran.

The S&P energy sector erased earlier losses to end the day up 0.78 percent as oil prices on the expectation that the sanctions would disrupt global crude supplies.

The decision to leave the agreement with Iran is likely to raise the risk of conflict in the Middle East, upset America’s European allies and disrupt global oil supplies. Trump said he is willing to negotiate a new deal with Iran.

Toward the end of the session, the stock market all but eliminated earlier losses. S&P 500 industrial, financial and technology indexes rose, while utilities and telecom services were the deepest decliners.

Comcast fell 5.56 percent after Reuters reported the cable operator is preparing to make an all-cash offer for media assets that Twenty-First Century Fox has agreed to sell to Disney for $52 billion.

After the bell, Disney edged up 0.5 percent after it reported its quarterly results that were powered by the hit superhero movie “Black Panther”.

Approximately 6.9 billion shares changed hands on the major domestic equity exchanges, as compared to the 6.5 billion share average over the past 20 trading days.