The stock market capped another week of healthy gains on Friday, but it ended on more of a befuddled note than a bang as confusion about the U.S.-China trade war hung over the market.

Stocks wobbled between small gains and losses through the day amid conflicting signals about the progress being made by U.S. and Chinese negotiators. President Donald Trump said he has not agreed to roll back any tariffs, just a day after a Chinese official said the two sides had agreed to do just that if talks progress.

Stocks and bond yields dipped immediately after Trump told reporters at the White House, "I haven't agreed to anything." But after flip-flopping through the day, the S&P 500 turned higher in the last hour of trading and closed at a record 3,093.08, up 0.3%.

It's the fifth straight week of gains for the index, which matches its longest winning streak in the last two years.

The Dow Jones Industrial Average edged up 6.44 points, or less than 0.1%, to 27,681.24, and the Nasdaq composite gained 0.5%, to 8,475.31.

"The general tone of the market will continue to be very cautiously optimistic," said JJ Kinahan, chief market strategist at TD Ameritrade. -- AP

Trendy back-to-school fashion ... Latest on Hofstra contract negotiations ... What's in store with weather Credit: Newsday

Inside look at NUMC's aging infrastructure ... District spent nearly $1M to fire teacher ... Suffolk town's ICE plans ... Trendy back-to-school fashion

Trendy back-to-school fashion ... Latest on Hofstra contract negotiations ... What's in store with weather Credit: Newsday

Inside look at NUMC's aging infrastructure ... District spent nearly $1M to fire teacher ... Suffolk town's ICE plans ... Trendy back-to-school fashion

SUBSCRIBE

Unlimited Digital AccessOnly 25¢for 6 months

ACT NOWSALE ENDS SOON | CANCEL ANYTIME