NEW YORK, July 2 (Reuters) - The S&P 500 and Nasdaq closed up on Wednesday, lifted by gains in tech stocks and news of a trade agreement between the U.S. and Vietnam that helped ease concerns about an extended trade war.
Nasdaq rose, boosted by Nvidia, Apple and Tesla.
Investors will look ahead to the non-farm payrolls report on Thursday for clues on how soon the Federal Reserve could lower borrowing costs.
Trump's massive tax-and-spending bill headed to the U.S. House of Representatives for possible final approval after the Senate passed the legislation. Nonpartisan analysts say it will add $3.4 trillion to the national debt over the next decade.
Markets opened lower after data showed U.S. private payrolls fell unexpectedly in June and job gains in the prior month were smaller than initially thought.
A weakening economy "is a very mixed bag", said Jim Awad, senior managing director at Clearstead Advisors LLC in New York.
"Employment softening and inducing the Fed to lower rates would be a positive. But if it softens too much, that would be a negative for growth and profits."
Trade deal sparks relief
Investors have been watching whether President Donald Trump 's administration continues to make progress on trade, said Michael Arone, chief investment strategist at State Street Global Advisors in Boston.
"There is some relief in regards to progress on trade. The deal with Vietnam was welcomed news," Arone said.
According to preliminary data, the S&P 500 gained 29.28 points, or 0.47%, to end at 6,227.29 points, while the Nasdaq Composite gained 190.24 points, or 0.94%, to 20,393.13. The Dow Jones Industrial Average fell 8.70 points, or 0.02%, to 44,486.24.
The U.S. and Vietnam struck a trade agreement that sets 20% tariffs on many of the Southeast Asian country's exports.

The Trump administration has teased that a deal with India is also coming soon, but has said others may not be ready by July 9.
Tesla stocks rebound
Tesla rose, bouncing after a drop early this week, even as the electric vehicle maker posted a big drop in second-quarter deliveries. Some traders said the numbers were less severe than analysts' bleak forecasts. The stock has shed more than 20% this year.
Centene tumbled after the health insurer said it had withdrawn its 2025 earnings forecast after data showed a significant drop in expected revenue from its marketplace health insurance plans.
The focus is on the more comprehensive non-farm payrolls report on Thursday, a day earlier than usual, with markets closed on July 4 for Independence Day. The reading is expected to show U.S. job growth cooled in June and the unemployment rate ticked up to 4.3%, according to a Reuters poll of economists.
"Investors are likely expecting this will push the Fed towards cutting rates sooner rather than later," Arone said.
Reporting by Sabrina Valle in New York; Sruthi Shankar and Nikhil Sharma in Bengaluru; Editing by Devika Syamnath, Pooja Desai and David Gregorio
This article originally appeared on USA TODAY: Stocks close on the upswing amid Vietnam trade deal