U.S. stocks ended lower on Tuesday, erasing much of the market's gain from the day before. The broad decline came as traders seized on the final day of the quarter to do some profit-taking and prune their portfolios.

On Tuesday:

The Dow Jones industrial average lost 200.19 points, or 1.1 percent, to 17,776.12.

The S&P 500 index fell 18.35 points, or 0.9 percent, to 2,067.89.

The Nasdaq composite shed 46.56 points, or 0.9 percent, to 4,900.88.

For the week:

The Dow is up 63.46 points, or 0.4 percent.

The S&P 500 index is up 6.87 points, or 0.3 percent.

The Nasdaq is up 9.67 points, or 0.2 percent.

For the year:

The Dow is down 46.95 points, or 0.3 percent.

The S&P 500 index is up 8.99 points, or 0.4 percent.

The Nasdaq is up 164.83 points, or 3.5 percent.