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 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 2.02 points, or 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. The indexes also closed out the week unevenly after several days of trading in a mostly narrow range.
Despite the day's big tech stock slide, more stocks rose than declined on the New York Stock Exchange.
U.S. stocks were coming off a two-day winning streak, which included a record high for the Nasdaq on Thursday. They were on track to extend those gains early Friday, each at one point trading above their most recent closing highs.
But then investors began to unload technology stocks. The sell-off centered on the biggest companies in the stock market: Apple, Microsoft, Alphabet and Facebook. But the biggest decliner was chipmaker Nvidia, which lost $10.34, or 6.5 percent, to $149.60.
Alphabet, Google's parent company, fell $34.16, or 3.4 percent, to $970.12, while Apple slid $6.01, or 3.9 percent, to $148.98.
"It's had a good run," said Scott Wren, senior global equity strategist for Wells Fargo Investment Institute. "People are taking a little money off the table."
The technology sector fell 2.7 percent. It remains up 18.5 percent for the year.
Traders also bid up shares in energy companies as the price of crude oil rose.
Helmerich & Payne added $2.87, or 5.7 percent, to $53.27. Rig operator Transocean picked up 39 cents, or 4.6 percent, to $8.81.
Benchmark U.S. crude gained 19 cents to close at $45.83 a barrel in New York. Brent crude, used to price international oils, added 29 cents to settle at $48.15 a barrel in London.
Small-company stocks were among the big gainers, receiving a boost from a stronger dollar following the British general election. A stronger dollar tends to benefit small-cap stocks, because they tend to not have as much exposure to international markets as large-cap stocks.
The pound lost more than 2 cents versus the dollar after the Conservatives lost their majority in Parliament, which could send Britain's negotiations to leave the European Union, due to start June 19, into disarray. The pound weakened to $1.2724 from $1.2943. The dollar also strengthened to 110.20 yen from 109.94 yen late Thursday. The euro weakened to $1.1195 from $1.1222.
Corporate deal news also led to some notable stock moves Friday.
DuPont Fabros Technology jumped 9.8 percent after the data real estate investment trust and owner of wholesale data centers was acquired by another REIT, Digital Realty Trust. The deal is an all-stock transaction valued at about $7.6 billion. DuPont Fabros Technology shares gained $5.44 to $60.80. Digital Realty slipped $3.43, or 2.9 percent, to $113.32.
Pandora Media rose on news that SiriusXM will invest $480 million in the online radio company. SiriusXM, which is buying preferred stock and taking a 19 percent stake in Pandora, will also select three people to be named to Pandora's board. Pandora is breaking off a deal with investment firm KKR from last month. Pandora added 10 cents, or 1.2 percent, to $8.52. SiriusXM slid 20 cents, or 3.7 percent, to $5.20.
Several companies fell after issuing weak outlooks.
VeriFone Systems shed 3.5 percent after the maker of terminals for electronic payments cut its forecasts and said it will sell or restructure several businesses. The stock lost 64 cents to $17.68.
HNI slumped 12.6 percent after the maker of office furniture and fireplaces cut its forecasts because of slower sales and falling wholesale revenue. The stock slid $5.64 to $39.27.
Bond prices fell. The 10-year Treasury yield held rose to 2.20 percent from 2.19 percent late Thursday.
In other energy trading, wholesale gasoline rose a penny to $1.50 per gallon. Heating oil inched up 1 cent to $1.43 per gallon. Natural gas added 1 cent to $3.04 per 1,000 cubic feet.
Gold fell $8.10 to $1,271.40 per ounce. Silver lost 19 cents, or 1.1 percent, to $17.22 per ounce. Copper gained 4 cents, or 1.5 percent, to $2.65 per pound.
Germany's DAX rose 0.8 percent, while France's CAC 40 gained 0.7 percent. Britain's FTSE 100 added 1 percent. Japan's Nikkei 225 added 0.5 percent, while South Korea's Kospi rose 0.8 percent. Hong Kong's Hang Seng slipped 0.1 percent.