People walk by the New York Stock Exchange, in New York City, Wednesday, June 15, 2016. Spencer Platt/Getty Images

Wall Street ended lower on Friday as Apple dragged down major indexes and investors girded for Britain's vote next week on its European Union membership.

For the week, the three indexes each posted declines of at least 1 percent, with the Nasdaq falling nearly 2 percent.

The possibility that Britain will vote to leave the EU on June 23 has been rattling global markets. U.S. stock markets could see heavy trading and increased volatility as investors position for next week's referendum.

"I don’t think we’re going to escape this until Thursday," said Jim Paulsen, chief investment strategist at Wells Capital Management in Minneapolis. "We’re just going to be tied to those anxieties going up or down between now and the Thursday vote."

The Dow Jones industrial average fell 57.94 points, or 0.33 percent, to 17,675.16, and the S&P 500 .SPX lost 6.77 points, or 0.33 percent, to 2,071.22.

The tech-heavy Nasdaq Composite dropped 44.58 points, or 0.92 percent, to 4,800.34.

Apple shares fell 2.3 percent. Apple said its iPhone 6 and 6 Plus were still available for sale in China after Beijing's intellectual property regulators barred sales, saying the designs had infringed a Chinese company's patent.

"There seems to be this perpetual stream of kind of quasi-negative news surrounding some of the really big market cap stocks, like Apple particularly, and anytime you have got Apple misbehaving that tends to put a damper on the averages," said Chuck Carlson, chief executive officer at Horizon Investment Services in Hammond, Indiana.

Fears over Brexit undercut the S&P 500's momentum after the benchmark index came within about 12 points of its record closing high last week. On Thursday, Wall Street had snapped a five-session streak of declines.

"Risk appetite has declined because of the Brexit vote," said Jeremy Zirin, head of investment strategy at UBS Wealth Management Americas in New York.

On Friday, five of the 10 S&P sectors ended lower. Energy shares were the best-performing group, gaining 0.8 percent, as oil prices jumped.

Recovering oil prices have helped the U.S. stock market rebound some 14 percent since mid-February. The S&P is now up more than 1 percent for the year.

The healthcare sector was the biggest laggard, falling 1.1 percent, as Merck and Johnson & Johnson declined.

Tech shares dropped 0.9 percent. The sector's declines were limited by Oracle, which rose 2.7 percent to $39.68 after better-than-expected quarterly revenue. The stock gave the biggest boost to the S&P.

Nearly 9 billion shares changed hands on U.S. exchanges, well above the 6.7 billion average over the past 20 trading days, according to Thomson Reuters data.

Advancing issues outnumbered declining ones on the NYSE by 1,844 to 1,156, for a 1.60-to-1 ratio on the upside; on the Nasdaq, 1,599 issues fell and 1,231 advanced for a 1.30-to-1 ratio favoring decliners.

The S&P 500 posted 12 new 52-week highs and 2 new lows; the Nasdaq recorded 39 new highs and 41 new lows.