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 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 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.

The Nasdaq Composite Index 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 (http://www.marketwatch.com/story/more-than-10-of-sp-500-stocks-are-in-a-bear-market-2018-02-08), defined as a 20% drop from a peak. Only 88 of the components aren't in correction territory.

(https://twitter.com/RyanVlastelica/status/961708128927657984)

The Cboe Volatility Index 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 (http://www.marketwatch.com/story/weekly-us-stock-market-volume-highest-since-august-2011-2018-02-09) were the highest since August of 2011, according to Wall Street Journal Digital Data.

Don't miss:Jim Cramer blames a 'group of complete morons' for blowing up the market (http://www.marketwatch.com/story/jim-cramer-blames-a-group-of-complete-morons-for-blowing-up-the-market-2018-02-08)

What's driving markets?

The Dow has suffered a pair of 1,000-point drops this week, including in Thursday's session, something that has never happened in history, as inflation fears and rising yields dogged markets.

President Donald Trump's signed of legislation to end a brief government shutdown after the House and Senate approved a budget deal (http://www.marketwatch.com/story/senate-passes-budget-deal-as-government-remains-shut-down-2018-02-09).

"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."

Shares of Mattel Inc.(MAT) rose 7.9% after the toy maker appointed a new chairman.

What are other assets doing?

European stocks (http://www.marketwatch.com/story/european-stocks-head-lower-after-wall-street-fails-to-rebound-2018-02-08)suffered their worst week in two years (http://www.marketwatch.com/story/european-stocks-head-for-worst-week-in-2-years-as-global-selloff-rages-on-2018-02-09), while Wall Street's late plunge hit Asia markets hard (http://www.marketwatch.com/story/asian-markets-skid-after-wall-street-sinks-into-correction-territory-2018-02-08), with several indexes posting their worst week in years. The Shanghai Composite Index closed down 4%, after losing as much as 6% in the session, while the Nikkei 225 index dropped 2.3%.

The yield on 10-year Treasury notes rose to 2.86%.

Gold futures settled 0.3% lower and marked the steepest weekly decline in two months (http://www.marketwatch.com/story/gold-prices-slip-set-for-2nd-straight-weekly-fall-as-global-stocks-fall-into-correction-2018-02-09), while crude-oil futures dropped 3.3% to settle below $60 a barrel (http://www.marketwatch.com/story/crude-oil-slides-for-6th-day-and-heads-for-76-weekly-slump-2018-02-09) for the first time this year. The ICE U.S. Dollar Index moved up 0.3% to 90.477, notching its biggest weekly advance since 2016 (http://www.marketwatch.com/story/dollar-on-track-for-best-week-since-october-despite-global-market-jitters-2018-02-09).