By Akane Otani
NEW YORK (Reuters) - U.S. stocks ended mostly lower on Tuesday, retreating from records set the previous month, as falling crude oil prices dragged energy shares down and offset strong manufacturing data.
The S&P energy index <.SPNY> fell 1.3 percent as the prospect of slowing demand for oil in China and Europe and concerns about an oversupply of oil brought Brent crude oil futures to their lowest price since May 31, 2013. Peabody Energy Corp was the biggest loser among the S&P energy names, falling 3.7 percent to $15.29.
The strengthening dollar, which rose to its highest this year against the yen, was also seen as weighing on oil prices.
"This isn't a cause of alarm for the market. We're just seeing energy pulling back a bit after a very big market rally and taking a bit of time to digest those gains," said Adam Sarhan, chief executive of Sarhan Capital in New York.
Despite the day's declines, energy shares have overall performed well, with the S&P 500 energy sector <.SPNY> outperforming the wider S&P index so far in 2014.
U.S. factory activity rose to its highest in nearly 3-1/2 years in August, and construction spending rebounded strongly in July.
Of the 30 stocks in the Dow industrials, Home Depot Inc was the worst performer, falling 2 percent to $91.15 after CNBC reported that hackers may have stolen credit card data from the company.
The Dow Jones industrial average <.DJI> fell 30.89 points, or 0.18 percent, to 17,067.56. The S&P 500 <.SPX> ended down 1.09 points, or 0.05 percent, at 2,002.28. The Nasdaq Composite <.IXIC> added 17.92 points, or 0.39 percent, to end at 4,598.19.
Digital Ally Inc shares soared 79 percent to $33.41, extending a rally that has pushed the stock up more than 900 percent since June 10, as outrage over the shooting of an unarmed black teenager in Ferguson, Missouri, has fueled interest in the use of wearable cameras by police.
Electric carmaker Tesla Motors Inc gained 5.3 percent to close at a record high $284.12 after Stifel Nicolaus raised its target price for the company's stock to $400.
Merger activity continued to flourish. Discount retailer Dollar General Corp raised its bid for Family Dollar Stores Inc by 2 percent to $80 per share, or $9.1 billion. Family Dollar shares edged up 0.5 percent to $80.22 while Dollar General advanced 0.6 percent to $64.36.
About 5.2 billion shares traded on all U.S. platforms, according to BATS exchange data, compared with the five-day average of 4.4 billion.
(Reporting by Akane Otani; Editing by Chizu Nomiyama, Nick Zieminski and Steve Orlofsky)