Stocks closed mostly down as Wall Street prepares for trade news out of meetings between the U.S. and China this week and more in Wednesday’s Stock Market Update.

Stocks rose earlier after comments from Treasury Secretary Steven Mnuchin raised hopes for a U.S.-China trade deal. But losses in what are considered the market’s safer sectors, such as consumer products and utilities, offset a strong performance by technology stocks.

“Optimism is growing that at least negotiations will progress on a viable path toward an agreement,” said Quincy Krosby, chief market strategist at Prudential Financial. “The market does not want to see that they leave the G-20 meeting and there’s no hope, no change for negotiations.”

The escalating trade dispute remains the biggest source of uncertainty looming over the market. Investors are worried the fallout from the tariffs could hurt global economic growth and corporate profits.

Even after losing some strength in afternoon trading, technology companies accounted for much of the market’s overall gains. Apple gained 2.1%.

Micron Technology was the biggest gainer in the S&P 500 after the chipmaker forecast improved demand for smartphone chips the rest of the year. Other chipmakers also posted solid gains.

Energy stocks rose as the price of U.S. crude oil climbed 2.7%. Hess and ConocoPhillips each added around 5%.

Several big banks rose as bond prices fell, sending yields higher. When bond yields rise it helps banks’ ability to charge higher interest on loans. JPMorgan Chase gained 0.6% and Citigroup rose 1%.

Health care stocks were the biggest drag on the market, with drugmakers leading the way lower for the sector. Eli Lilly dropped 3.4% and Nektar Therapeutics dropped 3.8%.

Consumer products companies also headed lower. J.M. Smucker dropped 3.7%.

General Mills slumped after the packaged foods maker’s latest quarterly results topped Wall Street’s expectations, but it also reported weak sales trends in North America.

STOCK MARKET UPDATE

KEEPING SCORE: The S&P 500 slipped 3 points or 0.1% to 2,913. The Dow slid 11 points to 26,536. The Nasdaq, with a heavy component of technology stocks, gained 25 points, or 0.3%, to 7,909.

Major stock indexes in Europe were mostly lower.

ALL ABOUT TRADE: This week’s G-20 meeting in Osaka, Japan, is the first opportunity Trump and Xi have had to thrash out the trade dispute face-to-face since Trump said he was preparing to target the $300 billion in Chinese imports that he hasn’t already hit with tariffs, extending them to everything China ships to the United States.

The two sides are in a stalemate after 11 rounds of talks that have failed to overcome U.S. concerns over China’s acquisition of American technology and its massive trade surplus. China denies forcing U.S. companies to hand over trade secrets and says the surplus is much smaller than it appears once the trade in services and the value extracted by U.S. companies are taken into account.

How the trade war develops could affect whether central banks move in to support the economy. Fed Chairman Jerome Powell this week noted that the economic outlook has become cloudier since early May amid uncertainty over trade and global growth. The Fed and the European Central Bank have indicated they are open to cutting interest rates if needed.

FEELING CHIPPER: Chipmakers rose broadly after Micron Technology reported solid quarterly results.

Micron said demand should pick up in the second half of the year, noting it has begun selling products to Huawei that Micron has determined are excluded from the Trump administrations’ ban on the sale of technology by U.S. companies to the Chinese telecom giant.

Micron shares vaulted 13.3%. Advanced Micro Devices climbed 3.6%, Nvidia gained 5.1% and Intel added 2.8%.

HEALTH SECTOR POLITICS: The televised Democratic presidential candidate debates on Wednesday and Thursday evening may weigh on health care stocks.

Many of the candidates have been arguing for expanding Medicare to cover uninsured Americans of all ages or some other form of universal health care coverage that would run counter to the current private insurance market.

“If ‘Medicare For All’ does not get a lot of air time or if other candidates criticize the proposal, we think that will be a positive for the market,” Raymond James analyst Chris Meekins wrote in a research note Wednesday.

Several health care providers were trading lower ahead of the first debate. UnitedHealth Group slid 1.6%, Anthem dropped 2.2% and Centene lost 3.5%.

NOT ENTIRELY APPETIZING: General Mills slid 4.4% after the maker of Cheerios cereal, Yoplait yogurt and other packaged foods reported quarterly results that exceeded Wall Street’s expectations, but also reported weak sales trends in North America.

© The Associated Press. All rights reserved.