By Anna Isaac and Caitlin McCabe

U.S. stocks rallied Monday after a choppy morning session as investors tried to assess how a rise in coronavirus-infection rates in some states may disrupt signs of a nascent economic recovery.

All three major indexes wavered throughout the morning before turning solidly positive in early afternoon trading. The Dow Jones Industrial Average was recently up about 100 points, or 0.4%. The S&P 500 added 0.5%, while the Nasdaq Composite rallied 0.8%, driven by gains among large-cap technology stocks.

Stocks are attempting to continue last week's rally, during which all three indexes ended the week up 1% or more. However, looming uncertainties surrounding the coronavirus pandemic, relations between U.S. and China and the November election have begun to weigh more heavily on investors. Data shows that infections have picked up pace in Arizona, South Carolina, Florida and Texas.

Those concerns have begun to mute this month's rally, 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.6% 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 months. Monday's stronger 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 easing, 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.

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.

Still, traders seemed unconcerned. Among the leaders Monday were big technology stocks and utilities companies, as well some retailers and restaurants. Microsoft gained 2.2% and Dominion Energy rose 2.8%, while Gap surged 6.3% and Chipotle Mexican Grill rallied 4.5%.

But there were big losses, too. American Airlines fell 7.2% 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. Rivals United Airlines Holdings and Delta Air Lines also dropped.

Many investors are watching rising coronavirus infections numbers, as they could potentially slow re-openings of businesses in some states. Mr. Fischer said traders will also likely begin paying closer attention to the presidential election in the coming weeks, too.

They will also be watching to see if the U.S. government increases or extends its stimulus measures, he said.

The Trump administration is preparing for a fresh wave of coronavirus cases, according to White House trade adviser Peter Navarro. A second wave of infections isn't necessarily expected, Mr. Navarro said Sunday, but the government is stockpiling drugs and equipment in case infections resurge in the fall.

Outside of the U.S. stock market, gold prices rallied, with front-month gold futures on pace for 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 down to 0.690%, from 0.696% Friday.

In Europe, oil-and-gas companies and travel and leisure stocks were among the worst performers. That left the pan-continental Stoxx Europe 600 wavering between gains and losses before ultimately losing 0.8%.

Payments company Wirecard plunged 44%, making it the worst performer among major European stocks. The troubled German business said early Monday that the $2 billion that banks were supposedly holding on its behalf probably doesn't exist.

In Asia, most major equity benchmarks dropped by the close of trading. 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 Anna Isaac at anna.isaac@wsj.com and Caitlin McCabe at caitlin.mccabe@wsj.com