(AP) -- Wall Street closed out a volatile week with losses Friday as investors worried that upcoming trade talks aimed at resolving the costly trade war between Washington and Beijing could be in trouble.
The selling, which erased modest early gains for the market, snapped a three-week win streak for the S&P 500. The benchmark index is still up 2.2% for September.
The afternoon market slide came as investors reacted to published reports indicating Chinese officials canceled a planned trip to farms in Montana and Nebraska and would be returning to China. Representatives from the U.S. and China were engaging in preliminary discussions over the next two weeks to lay the groundwork for more formal negotiations next month.
Markets rallied this month after the U.S. and China took steps to ease tensions in advance of their next round of talks. That had fueled speculation among investors that the two countries may at least reach an interim deal on trade --- although President Donald Trump told reporters around midday Friday that he wants a complete deal with China and won't accept one that only addresses some of the differences between the two nations.
Trump also said he doesn't feel he needs to secure an agreement before next year's election.
"This is why China has been reluctant to continue to negotiate with the Trump administration, because as soon as it looks like we're moving toward some sort of constructive talks, there is a change in direction and it seems like a lot of head fakes," said Ben Phillips, chief investment officer at EventShares.
The S&P 500 fell 14.72 points, or 0.5%, to 2,992.07. The Dow Jones Industrial Average dropped 159.72 points, or 0.6%, to 26,935.07. The index had been up about 100 points then swung as low as 168 points.
The Nasdaq lost 65.20 points, or 0.8%, to 8,117.67, weighed down by declining technology sector stocks. The Russell 2000 index of smaller company stocks slid 1.72 points, or 0.1%, to 1,559.76.
Major European indexes closed mostly lower.
Even with Friday's selling, the S&P 500 remains relatively close to its all-time high. The benchmark index held steady this week despite volatility caused by a swing in oil prices and the Federal Reserve's latest interest rate cut.
On Monday, oil prices spiked more than 14% after a key Saudi Arabian oil processing facility was attacked. Oil prices retreated after the Saudi government said production could be restored by the end of the month, although they're still up nearly 6% for the week.
The Federal Reserve cut interest rates for the second time this year as it tries to shore up economic growth amid a lingering trade war between the U.S. and China and weak economic growth overseas. The central bank left open the possibility of additional rate cuts if the economy weakens.
The U.S. and China have slapped import taxes on hundreds of billions of dollars' worth of each other's products in a tariff war that has weighed on global trade and economic growth and created uncertainty for businesses deciding where to situate factories, find suppliers and sell their products.
The two countries appeared to be nearing a deal in early May, but talks stalled after the U.S. accused China of reneging on earlier commitments.
"The market is at a pretty fragile point right now," Phillips said. It's at all-time highs and there are risks, it seems like, building everywhere globally, with trade being the biggest one."
Technology stocks accounted for the biggest share of the market's losses. The sector is particularly sensitive to swings on the trade conflict because many companies manufacture products in China. Apple slid 1.5% and Microsoft dropped 1.2%.
Retailers and other companies that benefit from consumer spending also declined broadly. Amazon fell 1.5% and Starbucks dropped 1.6%.
Financial stocks veered lower as bond yields declined. The yield on the 10-year Treasury fell to 1.72% from 1.77% late Thursday. Bond yields, which can affect interest rates on mortgages and other consumer loans, slid steadily all week. Bank of America and American Express each fell 0.8%.
Netflix led communications services companies lower, sliding 5.5%. In an interview with Variety published Friday, Netflix CEO Reed Hastings acknowledged that the company faces tough competition from Disney, Apple and other companies rolling out streaming services in November. Netflix shares are down nearly 26% this quarter.
Shares in health care companies and utilities stocks rose. Johnson & Johnson added 1.2% and Exelon gained 1.4%.
Semiconductor maker Xilinx tumbled 6.8% as its chief financial officer, Lorenzo Flores, leaves the company for Toshiba Memory Holdings, where he will be vice chairman. Flores will stay at Xilinx through its second quarter financial report.
Benchmark crude oil fell 4 cents to settle at $58.09 a barrel. Brent crude oil, the international standard, dropped 12 cents to close at $64.28 a barrel.
Wholesale gasoline fell 2 cents to $1.68 per gallon. Heating oil declined 1 cent to $1.99 per gallon. Natural gas fell 1 cent to $2.53 per 1,000 cubic feet.
Gold rose $8.90 to $1,507.30 per ounce, silver fell 3 cents to $17.74 per ounce and copper was unchanged at $2.59 per pound.
The dollar fell to 107.67 Japanese yen from 107.97 yen on Thursday. The euro weakened to $1.1015 from $1.1052.