U.S. stock-market indexes did an about-face in late-Friday action, booking sharp gains for the session, but recording the worst weekly losses in about two years, during one of the most frenetic stretches of trading on Wall Street.

Climbing bond yields and higher inflation have been partly to blame for igniting once-dormant volatility in the market, with investors already on edge over lofty equity valuations following a mostly relentless uptrend for assets perceived as risky.

What are the main benchmarks doing?

The Dow Jones Industrial Average
DJIA, -0.40%
finished the session up 330.44 points, or 1.4%, to 24,190.90, spanning more than 1,021 points as the blue-chip gains made powerful intraday swings in to and out of positive and negative territory. For the week, the Dow closed down 5.2%, marking its largest weekly decline since January 2016.

The S&P 500
SPX, -0.35%
ended up 38.55 points, or 1.5%, to 2,619.55, with 10 of the 11 main sectors finishing with gains. Technology shares led the advance, up 2.5%, while energy shares were the only laggards, down 0.4%. The broad-market gauge spanned more than 100-points Friday moves.

For the week, the benchmark index lost 5.2%, also marking its largest weekly drop since early January 2016.

The Nasdaq Composite Index
COMP, -0.39%
closed up 97.33 points, or 1.44%, to 6,874.47, but finished the week 5.1% lower, representing its worst week since early February of 2016

On Thursday, the S&P 500 and the Dow entered correction territory, defined as a decline of at least 10% or more from recent highs.

According to financial blog SentimenTrader, Thursday’s drop marked the Dow’s fourth-fastest decline into correction territory from an all-time high, based on data that goes back to 1897.

Based on Thursday’s close, 96 of the S&P 500’s components are in bear market territory, defined as a 20% drop from a peak. Only 88 of the components aren’t in correction territory.

The Cboe Volatility Index
VIX, -1.66%
also switched between gains and losses and closed 13.2% lower at 29.06. The so-called “fear index” has more doubled so far this year; the S&P has undergone seven sessions with a 1% move in 2018, nearly equaling the number of such moves seen over the entirety of 2017.

As markets whipsawed, weekly trading volumes were the highest since August of 2011, according to Wall Street Journal Digital Data.

“Right now markets are moving more on the emotions of trading, rather than economic fundamentals. Once the fears get rolling, it’s purely sentiment and what traders can imagine in terms of where things can be going that drive price action,” said Bruce McCain, chief investment strategist at Key Private Bank.

“We could have fallen enough to account for the new inflation fears, but we need to form a pretty stable base before investors can feel reassured the bottom won’t fall out from under them, and it will take some more price action before that occurs.”

Intraday Data provided by SIX Financial Information and subject to terms of use. Historical and current end-of-day data provided by SIX Financial Information. All quotes are in local exchange time. Real-time last sale data for U.S. stock quotes reflect trades reported through Nasdaq only. Intraday data delayed at least 15 minutes or per exchange requirements.