U.S. stocks rose on Tuesday, with the Dow and S&P on track for their fourth straight session of gains, on optimism progress was being made toward a deal to resolve the conflict between Russia and Ukraine.

Russia pledged to cut down on military operations around Kyiv and in northern Ukraine, while Ukraine proposed adopting a neutral status, the first sign of progress toward peace in weeks.

The tentative progress contributed to a fall in prices of oil and other commodities, helping calm concerns about rising inflation and the path of monetary policy by the Federal Reserve, which has started to raise interest rates to combat rising prices.

"If you look over the course of the month this war has been going on, the market has priced in much more bad news than good news," said Art Hogan, chief market strategist at National Securities in New York.

"It certainly shows the market has a natural coiled spring that will be a reaction function to any good news and we saw a bit of that this morning, but everything will have to be taken with a grain of salt and we will have to see things actually play out versus being actually talked about."

The Dow Jones Industrial Average rose 263.28 points, or 0.75%, to 35,219.17, the S&P 500 gained 46.87 points, or 1.02%, to 4,622.39 and the Nasdaq Composite added 243.56 points, or 1.7%, to 14,598.46.

After a dismal start to the year for stocks that saw the S&P 500 fall into a correction, commonly referred to as a drop of more than 10% from its most recent high, the benchmark index is now down about 3% on the year.

Still, there were signs of market nervousness that the Fed could make a policy mistake that leads to slowdown, or even a recession, in the economy as the widely tracked U.S. 2-year/10-year Treasury inverted for the first time since September 2019.

"This is one more item that the bond market is concerned about that the equity market is shrugging off," said Jack Ablin, chief investment officer at Cresset Capital Management in Chicago.

After slumping more than 2% on Monday, the S&P energy index was the only declining sector as crude prices fell more than 1%.

As the conflict in Ukraine has escalated in recent weeks, already rising prices saw more upward pressure on commodities such as wheat, energy and metals.

Even with the recent surge in inflation, data on Tuesday showed U.S. consumer confidence rebounded from a one-year low in March, while the current labor environment favors workers.

Real estate up more than 2% on the session, was the best performing sector, which indicates some investors may see inflation remaining but no recession on the horizon.

FedEx Corp gained 2.99% after the global delivery conglomerate named operating chief Raj Subramaniam as its top boss.

Advancing issues outnumbered declining ones on the NYSE by a 3.63-to-1 ratio; on Nasdaq, a 3.16-to-1 ratio favored advancers.

The S&P 500 posted 46 new 52-week highs and no new lows; the Nasdaq Composite recorded 63 new highs and 33 new lows.