NEW YORK (Reuters) - The Nasdaq fell more than 1 percent on Wednesday, dented by technology stocks after Facebook Inc FB.O and Twitter Inc TWTR.N executives defended their companies before skeptical U.S. lawmakers.

Adding to pressure on technology stocks, the Justice Department later said it would meet with state attorneys general to discuss worries that social media platforms were “intentionally stifling the free exchange of ideas.” Facebook and Twitter were not specifically named.

Twitter shares dropped 6.1 percent. Facebook shares fell 2.3 percent, contributing heavily to both the Nasdaq’s and the S&P 500’s declines. The Dow, however, eked out a slight gain.

Shares of other tech companies, including Alphabet Inc GOOGL.O, Snap Inc SNAP.N and Microsoft Corp MSFT.O, also fell. In the consumer discretionary sector, investors also sold off shares of Amazon.com Inc AMZN.O and Netflix Inc NFLX.O, two members of the group of stocks known as FANG.

Tech and consumer discretionary stocks were the biggest weights on the S&P 500. The S&P 500 technology index fell 1.5 percent, and the S&P 500 consumer discretionary index fell 1.1 percent.

“Because these companies have become so prominent, they’re attracting scrutiny on the part of regulators and legislators,” said John Carey, managing director at Amundi Pioneer Asset Management in Boston. “They remain market leaders, but there are potential risks.”

The Dow Jones Industrial Average .DJI rose 22.51 points, or 0.09 percent, to 25,974.99, the S&P 500 .SPX lost 8.12 points, or 0.28 percent, to 2,888.6 and the Nasdaq Composite .IXIC dropped 96.07 points, or 1.19 percent, to 7,995.17.

Energy stocks added to the S&P 500’s losses.

Halliburton Co HAL.N fell nearly 6.0 percent after the oilfield services provider warned third-quarter earnings could be hurt from moderating activity in the Permian Basin and a slower-than-expected ramp-up of new Middle East contracts.

Rival Schlumberger NV SLB.N dropped 1.5 percent and Baker Hughes BHGE.N, the oilfield services arm of General Electric GE.N, fell 2.2 percent.

With concerns over trade simmering, Commerce Department data showed that the U.S. trade deficit hit a five-month high in July, which economists said could heighten the White House’s resolve to aggressively pursue an “America First” approach to trade.

The data comes amid concerns that a U.S. proposal to impose tariffs on $200 billion more in Chinese imports could go into effect soon after a public comment period ends on Thursday, even as the U.S.-Canada talks to renegotiate the North American Free Trade Agreement continue.

China's JD.com Inc JD.O slid 10.6 percent, down for the second day in a row, after police said the retailer's Chief Executive Officer Richard Liu was arrested in Minneapolis last week after a rape allegation. Liu has denied any wrongdoing and was released on Saturday.

Declining issues outnumbered advancing ones on the NYSE by a 1.30-to-1 ratio; on Nasdaq, a 1.63-to-1 ratio favored decliners.

The S&P 500 posted 45 new 52-week highs and nine new lows; the Nasdaq Composite recorded 97 new highs and 51 new lows.

Volume on U.S. exchanges was 7.03 billion shares, compared to the 6.15 billion average over the last 20 trading days.