Wall Street turned in an uneven finish Friday as investors unloaded their technology company shares in favor of energy and financial stocks.

The tech-heavy Nasdaq composite, which has outpaced gains by other U.S. stock indexes this year, fell the most. The sell-off centered on the biggest companies in the stock market: Apple, Microsoft, Alphabet and Facebook.

The Standard & Poor’s 500 index closed slightly lower.

Even with the sell-off in technology stocks, the Dow Jones industrial average and the Russell 2000 index of small-company stocks closed higher, each setting new highs.

“We’re seeing investors rotate out of the international stocks and into the U.S. stocks in general,” said Sam Stovall, chief investment strategist at CFRA Equity Research. “And also a rotation out of technology and into energy, materials and financials.”

All told, the S&P 500 index fell 0.1 percent, to 2,431.77. The Dow gained 89.44 points, or 0.4 percent, to 21,271.97. The Nasdaq declined 113.85 points, or 1.8 percent, to 6,207.92. The Russell 2000 picked up 6.09 points, or 0.4 percent, to 1,421.71.

Despite the day’s big tech stock slide, more stocks rose than declined on the New York Stock Exchange.

advertisement | advertise on newsday

U.S. stocks were coming off a two-day winning streak, which included a record high for the Nasdaq on Thursday.