U.S. stocks capped their strongest month since November by shrugging off woes at two of the biggest companies in the stock market, Apple and Amazon.com.

Both companies warned investors Thursday afternoon that ongoing supply-chain disruptions were affecting their operations. Apple said the snarls were hindering the manufacturing of iPhones and other products and would bring increased difficulties during the holiday-shopping season. Amazon, meanwhile, posted lower-than-expected third-quarter sales and signaled that a tight labor...

U.S. stocks capped their strongest month since November by shrugging off woes at two of the biggest companies in the stock market, Apple and Amazon.com.

Both companies warned investors Thursday afternoon that ongoing supply-chain disruptions were affecting their operations. Apple said the snarls were hindering the manufacturing of iPhones and other products and would bring increased difficulties during the holiday-shopping season. Amazon, meanwhile, posted lower-than-expected third-quarter sales and signaled that a tight labor market and supply-chain issues would weigh on fourth-quarter earnings.

For months, investors have been on high alert about such economic disruptions and have tried to determine the impact that stickier-than-expected inflation, labor shortages and shipping and logistics delays would have on global markets.

Two giant companies gave negative signals, and stocks still continued to rise, showing the resilience of the bull market that began in the midst of a global pandemic. Despite concerns, money managers and equity strategists say they have been encouraged by the strength of the current earnings season and see few places outside the stock market for large, consistent returns. On Friday, all three major U.S. indexes ended at all-time highs, with the S&P 500 notching its 59th record close of the year.

“I think investors are taking [Apple and Amazon’s earnings results] in stride because they’ve seen broader strength across the market” during earnings season, said Keith Lerner, co-chief investment officer at Truist Advisory Services. “You’re seeing this quarter that corporate America is showing how adaptable it is.”

The benchmark index added 8.96 points, or 0.2%, Friday to end at 4605.38. For the month, it added 6.9%, the index’s largest percentage gain since last November. The technology-heavy Nasdaq Composite also notched its best performance since November, adding 7.3% for October. For the day, the index added 50.27 points, or 0.3%, to finish at 15498.39.

The Dow Jones Industrial Average, meanwhile, gained 89.08 points, or 0.2%, Friday to end at 35819.56. For October, the index gained 5.8%, its best monthly showing since March.

Apple shares lost $2.77, or 1.8%, to end at $149.80. Amazon.com shares declined by $74.14, or about 2.2%, to end at $3,372.43. Together, the companies account for nearly 10% of the S&P 500’s market capitalization.

The U.S. stock market’s strong performance in October marks a sharp turnaround from September, when stocks fell as fears about issues ranging from inflation to China’s property market flared. But low volatility and a strong earnings season helped turn the U.S. stock market around in October. About 82% of S&P 500 companies that have reported so far this season have beaten expectations for earnings, according to FactSet data from early Friday afternoon.

Throughout earnings season, companies across many sectors have warned about supply-chain and labor constraints. But many are also betting customers will keep paying higher prices.

Supply-chain problems are “not a terrible thing for corporate profits,” said Jonathan Golub, chief U.S. equity strategist and head of quantitative research at Credit Suisse.

On Friday, the two largest U.S. oil companies, Exxon Mobil and Chevron, reported their most profitable quarterly earnings since before the pandemic. Exxon gained 16 cents, or about 0.3%, to end at $64.47. Chevron added $1.37, or 1.2%, to finish at $114.49.

Starbucks shares fell by $7.13, or 6.3%, to $106.07 after the coffee chain said its U.S. sales were strong, but the pandemic’s resurgence in China had dragged on revenue.

The Port of Los Angeles is struggling to keep up with the crush of cargo containers arriving at its terminals.

Fresh data Friday from the Commerce Department showed that Fed’s preferred inflation gauge, the personal-consumption-expenditures price index, rose 4.4% in September from the previous year, the fastest pace since 1991. The department also said consumer spending grew more slowly in September, as the Covid-19 Delta variant and supply-chain disruptions weighed on households. 

Overseas, the pan-continental Stoxx Europe 600 added 0.1% for the day and 4.6% for the month. Shares of Volvo Cars, the Swedish auto maker controlled by China’s Zhejiang Geely Holding, rose sharply Friday, closing the day 23% above their offering price when it started trading Friday in Stockholm.

In bond markets, the yield on the 10-year Treasury note ticked down to 1.555% from 1.568% Thursday. Yields fall when prices rise. 

Overall, strong earnings supported a stock rally in October.

Photo: BRENDAN MCDERMID/REUTERS

Investors sold off eurozone government bonds after fresh data showed that inflation in the eurozone accelerated in October at the fastest pace since July 2008. 

This came after European Central Bank President Christine Lagarde said Thursday that investors were wrong to expect the ECB to increase interest rates next year in response to rising inflation. The selloff in bond markets this week suggests investors doubt the central bank’s ability to hold that line.

“The market was betting on the full credibility of the ECB, and is now having doubts,” said Sebastien Galy, macro strategist at Nordea Asset Management. 

In Asia, stock indexes closed with mixed performance. China’s Shanghai Composite added 0.8% for the day, but posted a 0.6% loss for the month. Hong Kong’s Hang Seng fell 0.7% on a daily basis but rose 3.3% for the month. South Korea’s Kospi declined 1.3% for the day and 3.2% for the month.

Write to Caitlin McCabe at caitlin.mccabe@wsj.com and Caitlin Ostroff at caitlin.ostroff@wsj.com