* U.S. May factory orders rise more than expected
* Energy shares tumble, technology shares up
The S&P 500 ended slightly higher on Tuesday as investors kept their focus on the growth trajectory of the U.S. economy, and the tech-heavy Nasdaq closed higher.
U.S. stocks have been under relentless selling pressure this year, with the benchmark S&P 500 index recording its steepest first-half percentage drop since 1970, as the Federal Reserve moves away from easy-money policy by raising borrowing costs.
Investors are waiting for minutes from the Fed's meeting in June on Wednesday as they brace for another 75-basis-point rate hike at the end of the month.
Traders are also keeping a watch on economic data, including a June nonfarm payrolls report expected on Friday, and on company commentaries for signs of peaking inflation and cooling economic growth, with another earnings season around the corner.
Data showed new orders for U.S.-manufactured goods increased more than expected in May, reflecting that demand for products remains strong even as the Fed seeks to cool the economy.
Separately, business growth across the euro zone slowed further in June and European natural gas prices surged again, reigniting worries of a recession in the bloc.
"The risks of an outright recession are nonzero and the probability is growing at this point that a recession could emerge later - this year, or perhaps even into early 2023," said Bill Northey, senior investment director at U.S. Bank Wealth Management in Minneapolis. "And the U.S. labor market continues to look quite healthy."
According to preliminary data, the S&P 500 gained 6.86 points, or 0.17%, to end at 3,831.80 points, while the Nasdaq Composite gained 195.65 points, or 1.76%, to 11,323.49. The Dow Jones Industrial Average fell 127.99 points, or 0.41%, to 30,969.27.
Benchmark U.S. Treasury yields tumbled on Tuesday and a key part of the yield curve inverted for the first time in three weeks as economic growth concerns dented risk appetite and increased demand for the safe-haven U.S. debt.
Energy stocks hit five-month lows as recession fears darkened the outlook for oil demand. The tech sector rose with rates coming down.