NEW YORK, May 26 : U.S. stocks rose on Tuesday, parting ways with their European counterparts, and falling WTI crude prices diverged from spiking Brent crude prices as investors weighed optimism over an imminent U.S.-Iran peace deal against dangers that the tenuous ceasefire could collapse. Tech shares, lifted by surging chip stocks, put the Nasdaq out front, while the S&P 500's gains were more modest. The blue-chip Dow was essentially unchanged."Regarding the U.S. markets going into a long weekend, something of a risk-off mentality takes hold for fear that something might happen over the weekend, and that's especially true right now, given all the global uncertainty," said Peter Tuz, president of Chase Investment Counsel in Charlottesville, Virginia. "We're in a risk-on mentality right now, kind of led by the stocks with the best earnings growth so far this year."

The fragile truce between the United States and Iran was imperilled after the U.S. conducted what it called defensive strikes, which Iran called a "gross violation" of the seven-week ceasefire. Even so, both sides indicated progress toward an agreement that would stop the war and resume shipping through the blockaded Strait of Hormuz."It's confusing, in that there was a lot of news over the weekend (suggesting) we're close to a deal," Tuz added. "Then this morning the headlines show the U.S. is bombing Iran."Economic data on Tuesday showed the mood of the American consumer, whose spending accounts for about 70 per cent of the U.S. economy, darkened slightly in May amid mounting inflation concerns.The Dow Jones Industrial Average was unchanged at 50,577.23, the S&P 500 rose 65.33 points, or 0.87 per cent, to 7,538.80 and the Nasdaq Composite rose 377.47 points, or 1.43 per cent, to 26,721.44. European shares dipped as fears that the U.S. missile strikes in southern Iran could disrupt peace negotiations and extend the Strait of Hormuz blockade, the closure of which has sent energy prices soaring, sparking inflation worries.Investors were also weighing comments from European Central Bank board member Isabel Schnabel, who said the central bank should hike rates in June, even if a U.S.-Iran peace deal is reached.MSCI's gauge of stocks across the globe rose 5.36 points, or 0.48 per cent, to 1,123.51.The pan-European STOXX 600 index fell 0.32 per cent, while Europe's broad FTSEurofirst 300 index fell 8.67 points, or 0.34 per cent.Emerging market stocks rose 9.23 points, or 0.54 per cent, to 1,720.64. MSCI's broadest index of Asia-Pacific shares outside Japan closed higher by 0.44 per cent, to 884.47, while Japan's Nikkei fell 162.10 points, or 0.25 per cent, to 64,996.09.The U.S. military's strikes on Iran sent Brent crude prices spiking, after having settled 7 per cent lower in the previous session. U.S. West Texas Intermediate (WTI) slid from Friday's close. There was no WTI settlement on Monday due to the Memorial Day holiday.U.S. crude fell 3.2 per cent to $93.51 a barrel, and Brent rose to $99.67 per barrel, up 3.67 per cent on the day.U.S. Treasury yields fell as hopes for a deal to reopen the Strait of Hormuz helped soothe inflation fears.The yield on benchmark U.S. 10-year notes fell 8 basis points to 4.493 per cent, from 4.572 per cent late on Friday.The 30-year bond yield fell 6.6 basis points to 5.0161 per cent from 5.082 per cent late on Friday.The 2-year note yield, which typically moves in step with interest rate expectations for the Federal Reserve, fell 6.3 basis points to 4.064 per cent, from 4.127 per cent late on Friday.The dollar held steady amid fluctuating hopes for a near-term resolution to the Middle East conflict.The dollar index, which measures the greenback against a basket of currencies including the yen and the euro, rose 0.1 per cent to 99.14, with the euro down 0.14 per cent at $1.1627.Against the Japanese yen, the dollar strengthened 0.21 per cent to 159.22.In cryptocurrencies, bitcoin fell 0.44 per cent to $76,863.78. Ethereum rose 0.3 per cent to $2,113.92.Gold prices fell as energy-driven inflation stoked bets of higher U.S. interest rates this year amid faltering hopes for a U.S.-Iran peace deal.Spot gold fell 1.03 per cent to $4,523.39 an ounce. U.S. gold futures rose 0.1 per cent to $4,525.60 an ounce.