Stocks closed a volatile month with strong gains on Friday on renewed bets the U.S. and China could strike a deal on trade.

The Dow Jones Industrial Average rose 199.62 points to close at 25,538.46. The and Nasdaq Composite both gained 0.8 percent to close at 2,760.17 and 7,330.54, respectively. Stocks wobbled for most of the session until Reuters reported that a Chinese official said "consensus is steadily increasing" in U.S.-China trade talks. The official added, according to the report, that differences between the two countries remained.