Stocks are ending lower on Wall Street after an early gain evaporated. The losses were led by companies that have been investor favorites including Microsoft, Apple and Amazon. The S&P 500 fell 0.5% Tuesday and the Nasdaq, which is dominated by tech companies, fell 1.4%. Small-company stocks, which took a beating in the sell-off that swept markets the last several weeks, ended higher. Other winning stocks included shopping mall owners, travel companies and other businesses that stand to benefit from economies reopening. The price of oil swung wildly again as concerns remain about crashing demand and a lack of storage space.

THIS IS A BREAKING NEWS UPDATE. AP’s earlier story is below:

Stock indexes are inching higher Tuesday, as some of Wall Street’s most downtrodden stocks flip into winners and some earlier stalwarts run out of momentum.

On the winning side were shopping-mall owners, travel companies and other businesses that got hammered after widespread stay-at-home orders locked their customers away. Some U.S. states and nations around the world are starting to gradually lift restrictions implemented to slow the spread of the coronavirus outbreak.

Stocks that have held up the best through this year’s sell-off, meanwhile, were down the most sharply on Tuesday. They included health care companies, big tech titans and winners of the stay-at-home economy such as Netflix and Amazon.

All the washing around left U.S. stock indexes mixed in early afternoon trading The S&P 500 was up 0.2%, as of 2:43 p.m. Eastern time, after flipping between an earlier gain of 1.5% and loss of 0.5%.

Like the stocks within the market, the day’s leaderboard for U.S. indexes was close to a mirror opposite of their performance for the year so far. The Nasdaq, which is dominated by big tech stocks and is the only major U.S. index up over the last year, was down 0.5%. The Russell 2000, which got beat up more than the rest of the market on worries about small companies’ financial strength, climbed 2%.

The Dow Jones Industrial Average was up 68 points, or 0.3%, to 24,201. It, like other indexes, gave up much of its gains after a report came out in the morning showing U.S. consumer confidence fell to its lowest level in nearly six years.

European stocks were strong, following a mixed showing in Asian markets. The price of U.S. oil remained wild, though, and it swung through more extremes as storage tanks come closer to hitting their limits.

With massive aid in place for the economy from central banks and governments, stocks have been building higher in recent weeks on anticipation that stay-at-home orders will gradually lift as infections level off in some hard-hit areas.

“Investors are taking that as a positive sign that it’s not going to be anytime soon, but we’re making progress,” said Katie Nixon, chief investment officer at Northern Trust Wealth Management.

Even though data continues to pile up showing the devastation hitting the economy following worldwide orders for businesses to shut down, some investors are looking past it to the prospect of a return of growth in the future.

“Hope is trumping caution this week so far,” Nixon said. “Investors are kind of looking over the valley.”

Harley-Davidson jumped 15.9% after laying out plans to slash costs and preserve cash, including a cut of its dividend and a halt to its stock buyback program. Norwegian Cruise Line rose 16.1%, and Kimco Realty, which owns shopping centers, added 10.5%

Sectors of the stock market that are tied most closely to the strength of the economy were also leading the way. Energy stocks rose 2.8% for the biggest gain among the 11 sectors that make up the S&P 500. Industrial stocks were close behind with a gain of 2.5%.

On the opposite side was Netflix, which set record highs recently amid captive audiences around the world. It slipped 3.7%. Other stay-at-home winners also fell, including a 2.1% drop for Amazon and a 0.3% dip for Clorox, whose disinfecting wipes have seen a surge in demand.

Signs of caution are prevalent throughout the market. Many professional investors are wary of the stock market’s big rally, which has driven the S&P 500 up nearly 30% since hitting a low late last month. Premature reopenings of economies could cause another wave of coronavirus infections.

Skeptics are also wary about how stocks have risen nearly as fast as they had earlier dropped in anticipation of a severe recession. The economy’s recovery may drag for a while as people tiptoe back to “normal” life and shopping patterns. That disconnect between a quick rebound for stocks and a potentially slower recovery for the economy could cause a reckoning later on.

Treasury yields, which had sent warning signals about the disastrous economic effects of the pandemic long before the stock market did, were down.

The yield on the 10-year Treasury fell to 0.60% from 0.65% late Monday. Yields tend to fall when investors are downgrading expectations for the economy and inflation.

Inflation recently has gotten weighed down by a plunge in oil prices. With airplanes, autos and factories around the world idled, demand has collapsed for energy, and producers have not cut back quickly enough. All the extra oil has flowed into storage tanks, which are close to hitting their limits.

A barrel of U.S. oil for delivery in June fell 44 cents, or 3.4%, to settle at $12.34 in volatile trading. It dropped as low as $10.07 earlier in the morning. Brent crude, the international standard, fell 34 cents, or 1.5%, to $22.75 a barrel.

In Europe, France’s CAC 40 gained 1.4% while Germany’s DAX rose 1.3%. Britain’s FTSE 100 gained 1.9%.

Japan’s benchmark Nikkei 225 edged 0.1% lower. South Korea’s Kospi gained 0.6%, and Hong Kong’s Hang Seng rose 1.2%.

The Federal Reserve began a two-day meeting Tuesday, but economists don’t expect it to add to the huge amounts of stimulus it has already deployed. The European Central Bank will hold its own meeting Thursday.

Nearly a third of the companies in the S&P 500 are scheduled to report their results for the first three months of 2020 this week and, more importantly, perhaps talk about how they see future conditions shaking out. That includes Amazon, Apple, Facebook, Microsoft and Google’s parent, Alphabet, which together make up about a fifth of the index.

___

AP Business Writer Yuri Kageyama contributed.

Copyright 2020 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed without permission.