Stocks closed at record highs on Wednesday as investors bet on a potential rate cut from the Federal Reserve later this month after the release of weaker-than-expected economic data.

The Dow Jones Industrial Average gained 179.32 points to end the day at 26,966, notching intraday and closing all-time highs. The Nasdaq Composite advanced 0.7% to 8,170.23.

The also rose 0.7% to 2,995.82 as the real estate and consumer sectors powered the broad index to record levels. Tech also boosted the index, rising 0.7% to a record high. The S&P 500 closed just 0.1% below 3,000.

"The first time we get there you'll probably see some profit-taking," said Scott Redler, partner with T3live.com. "If technology continues to be strong and the semiconductors get some kind of bounce, that could probably push the S&P 500 through it 3,000. It's good to see the FANG names show some power."

Shares of Facebook, Amazon, Netflix and Google-parent Alphabet all rose on Wednesday. The session ended at 1 p.m. ET due to the Fourth of July holiday.

Private payrolls in the U.S. increased by 102,000 in June, ADP and Moody's Analytics said. Economists polled by Dow Jones expected growth of 135,000.

The disappointing data strengthens the Fed's case for lowering rates at its monetary policy meeting at the end of July. Last month, the central bank opened the door to easier monetary policy by stating it will "act as appropriate" to maintain the current economic expansion.