U.S. stocks closed mostly higher on Tuesday, as a sharp rally in technology stocks helped the S&P 500 and the Nasdaq shake off an early decline. However, the Dow fell for a third straight session as caution remained high ahead of the conclusion of a Federal Reserve policy meeting and fresh developments in global trade.

The Dow Jones Industrial Average DJIA, -0.36% fell 64.1 points, or 0.3%, to end at 24,099.05. While the blue-chip average ended well off its lows of the session, having previously dropped more than 1%, it notched third straight daily decline. At its low of the day, the Dow was on track for its lowest close since April 2.

The S&P 500 index SPX, -0.73% rose 6.75 points to 2,654.8, a gain of 0.3%. The Nasdaq Composite Index COMP, -1.18% rose 64.44 points, or 0.9%, to finish at 7,130.70, supported by a rise in Apple and other major technology companies.

Tech was by far the biggest outperformer of the day, with the sector ending up 1.5%. That was enough to offset broad weakness elsewhere, as six of the 11 primary S&P 500 sectors ended lower and other industries saw only modest gains on the day. Among the biggest decliners were consumer staples, which fell 0.9%, and energy, which lost 0.6%.

Don’t miss:The stock market has no leader right now—here’s why that might be bad news

What’s driving markets?

The Federal Reserve began a two-day meeting Tuesday. When it wraps, the central bank is expected to leave interest rates on hold and signal no change to a tightening path of two more rate increases in 2018. Changes to Fed policy—in addition to interest rates, the U.S. central bank is shrinking the size of its balance sheet—are widely seen as one of the biggest headwinds facing markets.

See:Why the Fed could make 4 rate increases this year

The U.S. tariffs on aluminum and steel imports were in focus again. President Donald Trump late Monday gave top allies—the European Union, Canada and Mexico—an extension to the tariff exemption to allow more time negotiate a new pact to avoid the levies. The tariffs of 25% on steel and 10% aluminum—already in effect against China, Russia, Japan and others—were slated to come into effect on May 1, but have now been pushed back to June 1.

“The U.S. decision prolongs market uncertainty, which is already affecting business decisions,” the European Commission said in response. “The EU should be fully and permanently exempted from these measures, as they cannot be justified on the grounds of national security.”

Trade relations have been a driver of action on stock markets recently, though the spotlight has been on tensions between the U.S. and China. Traders are likely to watch U.S. Treasury Secretary Steven Mnuchin’s visit to China this week for high-level trade talks.

What are strategists saying?

“The stock market has been generally moving sideways for weeks. Investors aren’t taking advantage of the strong earnings because there’s also a lot of potentially negative news out there, between tariffs, the prospect of the Fed acting more aggressively, and so forth,” said Jon Maier, chief investment officer at Global X Funds.

Read:Here’s another reason stock-market bulls need to watch rising bond yields

“Now that we’re nearing the end of the earnings season, how much better can we expect the news to get? What will the impetus for our getting out of this range? Remember, just because we get out of the range, that doesn’t necessarily mean it’s because we broke out of it. We can also fall below what we’ve seen lately.”

Read more:Stock-market bulls lose hope as indexes trade in a tight range

Don’t miss:Expectations for stock returns are at their lowest point since before the financial crisis, Morgan Stanley says

Which stocks are in focus?

Shares of Boeing Co. BA, -0.72% fell 1.2% after the airplane maker said it plans to buy plane-parts specialist KLX Inc. US:KLXI for $3.2 billion. KLX sank 8.6%.

Merck & Co. Inc. MRK, +0.50% reported a first-quarter profit beat and sales miss early Tuesday. Shares fell 1.5%. Pfizer Inc. PFE, +0.08% shares declined 3.3% after the company reported a first-quarter sales miss. Both stocks were among the biggest drags in the Dow.

Aetna Inc. US:AET reported Tuesday that it swung to first-quarter net income of $1.21 billion, or $3.67 a share, from a loss of $381 million, or $1.11 a share, in the same period a year ago. Shares fell 0.2%.

U.S.-listed shares of BP PLC BP, -1.13% rose 0.5% even after the oil giant reported its strongest quarterly profit since mid-2014, lifted by higher oil prices and rising production.

Shares of Tenet Healthcare Corp. THC, -6.75% surged 19% after the company’s first-quarter earnings topped expectations late Monday.

Shares of Archer Daniels Midland Co. ADM, -1.93% fell 0.8% after the company reported first-quarter earnings that topped analyst expectations.

Vista Outdoor Inc. VSTO, -8.69% tumbled 13% after it announced a business plan in which it will focus on its core brands in ammunition, hunting and shooting accessories, hydration bottles and packs and outdoor cooking products.

Technology stocks supported the market. Apple Inc. AAPL, -1.61% gained 2.3%, rallying ahead of the release of its quarterly results. Also supporting the industry was Microsoft Corp. MSFT, -1.36% , which rose 1.6%, and Google-parent Alphabet Inc. GOOGL, -2.13% , up 2.2%. The PHLX Semiconductor index SOX, -0.49% rose 1.7%; Nvidia Corp. NVDA, -0.92% added 1% while Advance Micro Devices AMD, -1.68% gained 2.3%.

Which data are in focus?

The Markit manufacturing purchasing managers index came in at 56.5 in April, compared with the March reading of 55.6. The ISM manufacturing index for April fell to 57.3 in April, a nine-month low. Construction spending rose 3.6% from the year-ago period.

Check out:MarketWatch’s Economic Calendar

Now Hiring: Robot Babysitters

What are other markets doing?

European stocks SXXP, +0.55% ended lower, with most markets closed for the May Day or Labor Day holiday. U.K. stocks UKX, +1.19% rose, boosted by a sliding pound GBPUSD, +0.18% after a reading on manufacturing activity fell to a 17-month low.

Many markets in Asia were also closed for the holiday. Stocks in Japan NIK, -0.05% closed 0.2% higher.