US stock markets closed higher on Tuesday, July 28, as investors rotated capital away from the technology sector.

The S&P 500 and Dow Jones Industrial Average both posted gains, marking a shift in sentiment following the previous session's volatility.

Gold also retreated, falling more than 1% as risk appetite returned to equities.

The rally was broad-based, with money flowing into defensive and value-oriented names as tech shares faced selling pressure.

The market move came against a backdrop of shifting geopolitical risk.

Oil prices fell sharply after US President Donald Trump declared that an interim peace deal with Iran was "over." The abrupt diplomatic reversal sent energy stocks lower, contrasting with the previous day's surge in crude prices when the deal's collapse was first reported.

Gold also retreated, falling more than 1% as risk appetite returned to equities.