Apple is back, baby.

A number of technology stocks had a disastrous day on Wednesday, another sign that jittery investors have recently become much less loyal to companies that were market darlings not long ago. But Apple aapl wasn’t among them. Shares of the consumer tech giant rallied as much of the rest of the sector slumped. Shares of Apple rose 2%. That edged its market capitalization up by $10 billion to $534 billion, making it once again the most valuable company in the world.

Shares of Google owner Alphabet googl , which briefly had taken that title from Apple, fell nearly 5%, taking its market cap down to just above $500 billion, and giving back some of its winnings from earlier in the week, when the search giant’s strong earnings report rocketed it past Apple. There was a similar selloff in Facebook fb stock, which had soared for the past several days following its own earnings results, though it recovered somewhat in the mid-afternoon, finishing down nearly 2% at market close.

Even as the overall market rallied throughout the day, with the Dow Jones Industrial Average rising a little more than 1%, the tech-heavy Nasdaq remained down, as companies including Tesla tsla and Yahoo yhoo each dropped by as much as 6% (they pared their losses towards the end of trading, closing the session down about 5% apiece). Internet companies including Facebook, Amazon amzn , Netflix nflx and Google (a.k.a. Alphabet)—a group nicknamed FANG stocks, which had been among last year’s best performers in the S&P 500—all plunged.

Shares of Amazon fell nearly 4%, adding to the company’s losses from last week when it reported results that disappointed investors. Netflix, for its part, had declined almost as much, but came back to end the day down less than 1%.

While it’s most definitely unrealistic to expect the same dazzling performance this year that the FANG stocks demonstrated in 2015 with as much as triple-digit returns—that bummer of an economic truism known as mean reversion, for one thing—there were signs Wednesday that the tech stock selloff would not turn into a bigger bloodbath or an all-out bear market. Most importantly, the Nasdaq and the FANG stocks in particular rallied powerfully in the late afternoon, stemming their steeper losses and coming back several percentage points from where they’d fallen earlier.

Why did the stocks apparently turn on a dime? Investors, realizing that many of the stocks had sold off for no good reason, saw an opportunity to buy them back at a cheaper price. And as long as investors react to selloffs by “buying the dip,” as the practice is called, bear markets stay at bay.