NEW YORK — U.S. stock indexes slipped again Monday as technology companies, which were near record highs last week, suffered a second day of sharp losses. Investors are changing course and selling some of the best-performing stocks of the year while buying companies that have struggled.

Technology companies have surged in recent months, and Monday almost all of the losses came from the big companies that have led the way recently: Apple, Microsoft, Facebook, and Alphabet, Google’s parent company. Stocks fell hard in early trading, but gradually recovered part of their losses as the day went on.

Julian Emanuel, an equity strategist for UBS, thinks technology stocks may fall a lot further and wind up 10 percent lower than they were last week. He said the technology companies should continue to do well, but the stocks have done so much better than the rest of the market in recent months that they are due for a downturn.

The Standard & Poor’s 500 index dipped 2.38 points, or 0.1 percent, to 2,429.39. The Dow Jones industrial average, which closed at a record high Friday, lost 36.30 points, or 0.2 percent, to 21,235.67. The Nasdaq composite dropped 32.45 points, or 0.5 percent, to 6,175.46. The Russell 2000 index of small-company stocks slid 2.50 points, or 0.2 percent, to 1,419.21.

Apple shed $3.66, or 2.5 percent, to $145.32 while Alphabet lost $8.31 to $961.81. Facebook fell $1.16 to $148.44 while Microsoft sank 54 cents to $69.78.