U.S. stocks fell sharply in choppy trade Wednesday, giving up earlier gains, as Wall Street wrapped up a volatile month for the major averages.

The Dow Jones industrial average closed 380.83 points lower at 25,029.20, with Caterpillar as the worst-performing stock in the index.

More than half of the day's losses came in the final hour of trading with the Dow losing more than 240 points in the final 60 minutes.

The pulled back 0.9 percent to close at 2,713.83, with energy as the worst-performing sector. The Nasdaq composite ended 0.8 percent lower at 7,273.01.

Jeff Kilburg, CEO of KKM Financial said the S&P 500 dipped below its 50-day moving average late in the session. "That forces some technical selling pressure and flushes out some weak longs," he said.

Earlier in the session, the S&P 500 and Nasdaq rose as much as 0.6 percent and 0.7 percent, respectively. The Dow gained as much as 166.12 points.

The Dow and S&P 500 snapped 10-month winning streaks, their longest since 1959. The Nasdaq posted a monthly loss for the first time in eight months. For the month, the Dow and S&P 500 closed lower by 4.3 percent and 3.9 percent, respectively. The Nasdaq closed February down 1.9 percent.

February was a volatile month for stocks. The major averages dipped in correction territory earlier this month, falling 10 percent from record highs set on Jan. 26. The move lower came as fears of rising inflation sent rates higher and sent market volatility surging after a year of unprecedented calm.

"The volatility is being caused by one overarching theme: The market doesn't know what to expect from the Fed," said Tom Essaye, founder of The Sevens Report. "There's uncertainty around that and it's going to continue for the next several months."