(CNBC) U.S. stocks closed lower Friday, with the Dow Jones industrial average and S&P 500 closing below their 50-day moving averages and posting their first three-week losing streak since January.

Financials led all 10 sectors lower, followed by energy, consumer staples, and industrials.

Consumer discretionary was the fifth-worst decliner, falling more than 1 percent in afternoon trade to erase year-to-date gains and joining tech, health care and financials as the only S&P sectors in the red for the year so far. Utilities is the top sector performer year-to-date, with gains of more than 13 percent.

Note: Read our discussion guidelines before commenting.