A tumultuous week for markets around the world ended with a rocky Friday session, putting the S&P 500 on the cusp of correction territory as investors continued an October retreat from risky assets.

As stocks tumbled in early trading, the benchmark stock index fell nearly 3% to breach the level that would place it 10% below last month’s record. But as was the case for much of a whirlwind week marked by intraday dips and sharp rebounds, stocks stabilized—before slipping again in the final hour of trading.

Although stocks recovered some of their early declines, all three major U.S. stock indexes head into the last three sessions of October on track for their worst month in more than eight years.

Worries about corporate revenue peaking and a slowdown in China and Europe potentially spilling over into the U.S. economy have sent stocks into a tailspin. Fast-growing internet firms have been some of the hardest hit during the turmoil, leading analysts to question whether companies that previously seemed immune to global growth fears can continue surging ahead.

Quarterly sales from Amazon.com and Google parent Alphabet disappointed investors, sending the two stocks sharply lower Friday and pushing the tech-heavy Nasdaq Composite to its worst week since March.