U.S. stocks ended a four-session losing streak on Tuesday, buoyed by a pause in the rapid ascent of oil prices, which in turn helped offset a report showing an increase in consumer inflation.

The market's upward movement came as crude oil prices, a significant factor in inflation and market sentiment, saw a temporary halt to their recent surge. This interruption provided a more favorable environment for equities, allowing investors to look past the inflation data.

Meanwhile, a measure of consumer inflation revealed a rise, indicating persistent price pressures in the economy. This inflation reading is closely watched by market participants and policymakers as it can influence interest rate decisions. However, the impact of the oil price retreat appeared to be the dominant driver in Tuesday's trading session, leading to a broader market advance.