Major U.S. indexes staged a strong rebound Friday, finishing a topsy-turvy week at fresh records.

The S&P 500 added 48.73 points, or 1.1%, to 4369.55, following its worst one-day retreat since June 18. The Dow Jones Industrial Average added 448.23 points, or 1.3%, to 34870.16. The Nasdaq Composite gained 142.13 points, or 1%, to 14701.92. All three indexes closed at highs.

The strong gains Friday helped stocks narrowly avert weekly losses, pushing the major indexes toward a third consecutive week of gains.

Many investors rushed to buy the stock-market dip after Thursday’s declines, continuing a trend that has become a feature of the stock market’s rally over the past year. That desire, alongside easing concerns about the economic recovery, lifted stocks on Friday and overshadowed any worries about President Biden’s executive order to limit corporate dominance.

“It’s certainly on my list of worries that wasn’t there yesterday,” said Chris Grisanti, chief equity strategist at MAI Capital Management, referring to the executive order. But Mr. Grisanti said that for people wondering if the party is over yet: “I don’t think it is.”

Friday’s sharp rebound after Thursday’s declines highlights how resilient the stock market has been, overcoming giant swings underneath the surface among individual stocks and sectors while hitting dozens of new records just halfway through the year.

Investors have been adjusting their outlooks for economic growth in the near future, spurring a rally in shares of technology and growth companies earlier in the week as Treasury yields plunged and bond prices rallied.

Investors grew worried that new Covid-19 variants could stall the global economic recovery despite vaccines being rolled out. Supply-chain bottlenecks and concerns over labor-market participation have also weighed on sentiment. That led some money managers to trim bets on companies that are most likely to benefit when the economy recovers, though many of those trades bounced on Friday, with energy and financial companies outperforming the rest of the market.

“Our overall economic forecast remains positive. We see this as a bull market,” said Katerina Simonetti, a private wealth adviser at Morgan Stanley Private Wealth Management.

Additionally, the week has been marked by big swings in the government bond market that have caught many investors off guard. The yield on the 10-year Treasury note had dropped for four consecutive days and ended Thursday at about 1.287%, its lowest level since Feb. 18. Yields move inversely to prices. On Friday, the yield on the 10-year Treasury note settled at 1.354%, down from 1.434% last week.

The Dow ended the week with gains despite a selloff Thursday.

The Dow ended the week with gains despite a selloff Thursday.

Photo: carlo allegri/Reuters

Some analysts have said that the bond market has been signaling more caution about the economic recovery than the stock market, which is trading at highs.

Recent data hinting at a slowdown or fresh hurdles to the economic recovery is weighing on investors’ appetite for risky investments, said Hani Redha, a portfolio manager at PineBridge Investments. Rising Covid-19 cases in many parts of the world are also prompting concerns about extended lockdowns and another potential blow to the tourism sector, he said.

“It is a cocktail of a lot of crosscurrents,” said Mr. Redha. “One camp out there is arguing we’re going back into slow growth all over again and it starts now and we’re not getting a vigorous reopening bounce or if we’ve had it, the party’s over.”

Among individual companies, Carver Bancorp rose $4.61, or 21%, to $26.50. The banking-services company’s shares more than doubled Thursday as individual investors piled in, hoping to force those who bet against the stock to unwind their positions and push the price higher.

Related Video

Covid-19 strain known as Delta is in at least 60 countries including the U.S. and likely to spread world-wide, Covid-19 Genomics U.K. Chair Dr. Sharon Peacock tells WSJ's Betsy McKay at the WSJ Tech Health event. The Wall Street Journal Interactive Edition

Shares of tech companies have also hit new highs this week, with Amazon.com and Apple stock jumping to records in recent sessions.

Brent crude, the international gauge for energy markets, added 1.9% to $75.55 a barrel on Friday. In recent days, traders have grappled with uncertainty about future supply levels due to a deadlock among members of the Organization of the Petroleum Exporting Countries and their allies.

Overseas, the pan-continental Stoxx Europe 600 rose 1.3%. The gauge shed 1.7% on Thursday in its worst one-day performance since May 11.

In Asia, major indexes closed mostly lower. South Korea’s Kospi declined 1.1%, while Japan’s Nikkei 225 fell 0.6% and China’s Shanghai Composite edged less than 0.1% lower. Hong Kong’s Hang Seng added 0.7%.

Write to Caitlin Ostroff at caitlin.ostroff@wsj.com and Gunjan Banerji at Gunjan.Banerji@wsj.com