By Stan Choe and Alex Veiga

Updated 4:51 pm ET

Stocks overcame a late-afternoon burst of selling and closed higher Tuesday, as gains in big technology companies outweighed losses in banks and elsewhere in the market.

The S&P 500 rose 0.5 percent after being up 1.1 percent earlier. It's the second straight sizable gains for the benchmark index following its worst week since June.

High-flying technology stocks, which have been driving the market higher throughout the pandemic, abruptly lost altitude earlier this month amid worries that their prices had simply climbed too high, even after taking into account their tremendous growth.

But the past two days has marked a reversal of that trend, with shares in technology companies and others that play a key role in online access and commerce climbing again. Microsoft rose 1.6 percent Tuesday, while Amazon gained 1.7 percent and Zoom Video climbed 1.8 percent.

A key reason tech stocks are climbing again is that investors' expectations that the companies' profits will boom as even more of daily life shifts online haven't changed.

"The things that are doing well or are beneficiaries or are working in this environment, for good reason, are the things that are going up," said Tom Martin, senior portfolio manager with Globalt Investments. "That isn't going to change until we get a notable change in one of the things that are uncertain: The virus itself and the effect that's having on the economy, and whether we get anything new on the fiscal stimulus front."

The S&P 500 rose 17.66 points to 3,401.20. The Dow Jones Industrial Average inched up 2.27 points, or less than 0.1 percent, to 27,995.60. The index swung between a gain of 237 points and loss of 61. The Nasdaq, which is heavily weighted with tech stocks, climbed 133.67 points, or 1.2 percent, to 11,190.32.

Stocks of smaller companies eked out a tiny gain. The Russell 2000 index of small-caps picked up 1.18 points, or 0.1 percent, to 1,538.15.

Because tech companies have grown so massive, their movements alone can dictate the market's performance more than ever. Tech stocks as a group account for nearly 28 percent of the S&P 500, and they're up 3.1 percent this week after slumping more than 4 percent in each of the prior two weeks.

Analysts expect more volatility for stocks in the months ahead as the market navigates uncertainty over the outcome of the election, pessimism that Democrats and Republicans in Washington will be able to reach a deal to send more aid to unemployed workers and an economy still struggling amid the pandemic.

Investors weighed a batch of mixed global economic data Tuesday.

Stocks in Europe and much of Asia ticked higher following reports showing retail sales in China were higher last month than a year earlier for the first such growth this year, after the pandemic pancaked the world's second-largest economy. In Europe's largest economy, a reading on German economic confidence rose more than expected.

In the United States, a report showed that industrial production also strengthened last month. But the growth wasn't as strong as economists were expecting. Other reports showed that manufacturing in New York State is expanding more than economists expected, as are import and export prices.

Treasury yields were relatively steady. The yield on the 10-year Treasury was at 0.67 percent, unchanged from late Monday. The 30-year yield ticked up to 1.44 percent from 1.41 percent.

Shorter-term rates remain pinned at lower levels on expectations that the Federal Reserve will keep its benchmark rate at nearly zero for some time to help the economy recover. The central bank is beginning its latest meeting on interest-rate policy Tuesday, and it will announce its decision on Wednesday. Economists say it could change some of the language around its existing pledge to buy bonds to support markets, but they expect no major news.

On the losing side was Carnival, which dropped 10.8 percent, making it the biggest decliner in the S&P 500. The cruise ship operator said it may sell up to $1 billion in stock to raise cash, and it reported a preliminary $2.9 billion loss for its latest quarter. More encouragingly, it also said its advance bookings for the second half of 2021 are similar to where booking positions were in 2018 for the second half of 2019, before the coronavirus pummeled the industry.

Financial stocks were also laggards. JPMorgan Chase fell 3.1 percent, losing an earlier modest gain. It trimmed its forecast for this year's net interest income, which measures how much profit it makes from interest payments for loans and other products after subtracting the interest it pays out on deposits.

In European stock markets, Germany's DAX returned 0.2 percent, and the French CAC 40 rose 0.3 percent. The FTSE 100 in London climbed 1.3 percent. Markets in Asia ended mostly higher.

Share:
More In Business
The Day Ahead: Earnings, April Housing Data, Netflix Upfront Presentation
Cheddar News checks in on what to look out for on The Day Ahead as earnings season continues with TJX Cos., Target and Take Two Interactive among those reporting on Wednesday. April housing starts data is also set to be released while Netflix will hold its upfront presentation virtually amid a continued writers' strike.
Fyre Fest II, Broadway Musical in the Works
Billy McFarland, who served four years in prison for the failed Fyre Festival in the Bahamas that saw investors lose millions, is back. McFarland joined Cheddar News to explain a new Fyre Festival he is planning along with a Broadway musical, both in the works.
Stretching Your Dollar: Tips for Creating a Summer Budget
Retail sales saw a modest uptick in April as inflation eased somewhat as consumers look toward the summer season to spend some more. Mario Payne, financial planner for Toams Financial, joined Cheddar News to provide some guidance on how to work up a responsible summer budget plan.
Load More