By Caitlin McCabe and Anna Isaac

U.S. stocks climbed Monday as investors continued to put faith in signs of a nascent economic recovery, even as coronavirus-infection rates rise in some states.

All three major indexes finished the day higher, despite a rocky morning session. Microsoft gained 2.8% to lead large-cap technology stocks higher, though they were also joined by shares of utility companies, as well as retailers and restaurants.

The Dow Jones Industrial Average gained 153.50 points, or 0.6%, to finish the day at 26024.96. The S&P 500 gained 20.12 points, or 0.6%, to close at 3117.86.

And the Nasdaq Composite rallied 110.35 points, or 1.1%, to 10056.47, a record close. The jump marked the index's seventh consecutive day of gains, its longest winning streak since December.

Monday's gains put the stock market on track to extend last week's rally, during which all three indexes ended the week up 1% or more, despite a stretch of turbulent days. Some investors expect that choppiness to continue, as looming uncertainties surrounding the coronavirus pandemic, relations between U.S. and China and the November election weigh on traders. Data shows that infections have picked up pace in Arizona, Florida and Texas.

Those concerns have helped push gold prices to multiyear highs and started to mute this month's stock performance, despite strong gains at the beginning of June. Earlier this month, technical measures flashed some bullish signals as a wider-ranging group of stocks began rising in lockstep, suggesting that stocks may have more room to run in the months ahead.

The wider gains also helped major indexes erase most of their losses for the year. The S&P 500 is down just 3.5% in the year to date.

Nevertheless, indexes have been moving in more of a narrow pattern in recent days as investors try to determine what may happen in the coming month. Monday's gains, however, could help stocks break out of the range.

"I would say we're in no man's land right now," said Nate Fischer, chief investment strategist at Strategic Wealth Partners. "I think to consolidate and move sideways is the best thing for the market. To have it take its breath and digest market events that really matter."

Traders have faced a dizzying amount of information lately, and murky corporate guidance has made it difficult to determine the path ahead. As a result, some have been looking to a number of unconventional metrics, such as restaurant reservations and airline travel figures.

Economic indicators have also been mixed. A strong pickup in retail sales, as well as signs that jobless claims are edging lower, have offered traders confidence that economic activity is picking up after weeks of widespread shutdowns.

Yet there are still signs that the recovery has a long way to go, and on Monday, fresh data showed that sales of previously owned homes dropped 9.7% in May from the prior month, as the coronavirus pandemic prevented shoppers from taking advantage of the typically busy spring homebuying season. Economists surveyed by The Wall Street Journal expected an 8.8% decline.

Monday's rally in big technology stocks underscored how the companies that led the stock market off its March lows are still popular among investors. Netflix rallied 3.2% and Apple gained 2.6%.

Netflix closed with a market value above $200 billion for the first time Monday, while Microsoft ended above $1.5 trillion for the first time.

Yet some of day's biggest gainers were more cyclical stocks. Gap surged 8.3%, Chipotle Mexican Grill added 5.9% and Dominion Energy rose 1.9%.

Still, there big losses, too. American Airlines fell 6.8% after the U.S. carrier said Sunday that it plans to raise $3.5 billion in debt and equity to boost its liquidity and help maintain operations through the pandemic. Royal Caribbean Cruises also stumbled, losing 6.2%, while Wynn Resorts shed 4%.

Part of the market's turbulence lately has been driven by a split between bullish and bearish sentiment within the investment community, said Shawn Snyder, head of investment strategy at Citi Personal Wealth Management.

"You have this situation where you have retail investors that have come into the market and they have an extremely bullish view...and institutional investors who are having a bit of a more cautious view," Mr. Snyder said. "You have these two camps that are trying decipher which view is right."

Uncertainty surrounding the coronavirus pandemic has contributed to some of investors' bearish sentiment, as it remains unclear if rising cases could slow reopenings in some states. On Sunday, White House trade adviser Peter Navarro said that the Trump administration is " filling the stockpile in anticipation of a possible problem in the fall." In a statement later, Mr. Navarro said that the administration doesn't "necessarily expect a second wave but prudence dictates that" the White House plans for it.

Outside of the stock market, gold prices rallied, with front-month gold futures nearing their highest close since October 2012, according to Dow Jones Market Data.

And in bond markets, the yield on the 10-year U.S. Treasury ticked up to 0.704%, from 0.696% Friday. Yields rise when bond prices fall.

In Europe, the pan-continental Stoxx Europe 600 lost 0.8%. Payments company Wirecard tumbled 44% after t he troubled German business said the more than $2 billion missing from its balance sheet probably doesn't exist.

In Asia, most major equity benchmarks dropped. Hong Kong's Hang Seng Index was among the biggest losers, down 0.5%. India's S&P BSE Sensex, meanwhile, gained 0.5%.

Write to Caitlin McCabe at caitlin.mccabe@wsj.com and Anna Isaac at anna.isaac@wsj.com