NEW YORK — A historic winning streak for stocks was shattered in February, but technology companies held up just fine.

February began with a steep plunge for stocks, and while they pulled off a quick recovery, most parts of the market could not make up all of their losses. The Standard & Poor’s 500 index, the benchmark used by many investors, had risen for 15 months in a row when dividends are included. That was the longest streak the index has ever recorded.

Tech companies fared much better than the rest of the market. They have made enormous gains since late 2016, and like the rest of the market they finished at record highs Jan. 26. Then a year of calm trading was shattered and the tech sector fell nearly 11 percent in just nine days.

By late February, Microsoft was back at record highs and Apple was close to its own records. Payment processor Mastercard and some chipmakers also recovered their losses.

The rebound showed investors hadn’t lost confidence in the industry. Instead they appeared to feel the companies had become bargains as their profits and the global economy kept posting strong growth.

At the end of February the S&P 500 was down 5.5 percent from its late January high. Aside from technology, no other S&P 500 index has regained all of its early February losses.