NEW YORK (AP) — 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.

This Wednesday, Feb. 28, 2018, image shows an Associated Press graphic. Including dividends, the Standard & Poor’s 500 index had risen for 15 months in a row before February 2018. That was the longest monthly winning streak in its history. (AP Graphic)

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.

This Wednesday, Feb. 28, 2018, image shows an Associated Press graphic. Following a drop in early February that took them far from the records they set in late January, technology companies rose faster than the rest of the market. However energy companies continued to struggle. (AP Graphic)

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.

This Wednesday, Feb. 28, 2018, image shows an Associated Press graphic. Technology companies such as Apple, Microsoft and Nvidia peaked in late January and slumped along with the rest of the market, but recovered to reach new highs by late February. (AP Graphic)

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.