Stocks ended the month of May with big losses, with the Dow and S&P 500 posting their worst one-day drops since mid-April, but major averages still logged monthly gains.

Traders cited technical reasons for the sharp late-afternoon selloff in addition to month-end rebalancing and window dressing.