The stock market closed out the first three months of the year Tuesday on a down note, erasing much of the gains from the prior day's big rally.

The Dow Jones industrial average slumped 200 points, knocking the blue-chip index slightly lower for the year. The Standard & Poor's 500 index ended the quarter with a meager gain of half a percent.

The broad decline came as traders seized on the final day of the quarter to do some profit-taking and prune their portfolios. Health-care stocks were among the biggest decliners. Oil prices extended their slide.

"It's the end of the quarter," said Anwiti Bahuguna, senior portfolio manager at Columbia Threadneedle Investments. "Today the markets are probably driven by that quite a bit, because people are rebalancing their portfolios."

The Dow fell 200.19 points, or 1.1 percent, to 17,776.12. The 30-company index is down 0.3 percent for the year.

The S&P 500 index slid 18.35 points, or 0.9 percent, to 2,067.89. The index is up 0.4 percent for the year. The Nasdaq composite lost 46.56 points, or 0.9 percent, to 4,900.88. The tech-heavy index ended the quarter up 3.5 percent.

Traders often look to close out positions to make their books look as healthy as possible at the end of a quarter.

Companies will begin reporting financial results for the first three months of the year next week. Earnings for companies in the S&P 500 index are expected to be down 3 percent overall, according to S&P Capital IQ.

On Tuesday, investors got a dash of encouraging data. The Conference Board said its consumer confidence index rose to 101.3 in March from a revised 98.8 reading in February.

All 10 sectors in the S&P 500 ended lower. Health-care stocks led the decline, falling 1.5 percent. The sector is still up 6.2 percent for the year. Celgene notched the biggest decline in the S&P 500. Its shares fell $4.74, or 4 percent, to $115.28.

Benchmark U.S. crude fell $1.08 to close at $47.60 a barrel in New York. Oil finished down $2.16, or 4.3 percent, for the month. Brent crude, a benchmark for international oils used by many U.S. refineries, fell $1.18 to close at $55.11 in London.

U.S. government bond prices rose. The yield on the 10-year Treasury note slipped to 1.92 percent from 1.95 percent late Monday.

In metals trading, gold fell $1.70 to $1,183.10 an ounce, silver fell eight cents to $16.60 an ounce and copper fell four cents to $2.74 a pound.

In other futures trading on the NYMEX, natural gas fell 0.4 cents to close at $2.640 per 1,000 cubic feet.