(CNBC) — U.S. stocks closed broadly higher on Wednesday after the midterm election results came in about as expected, lifting a cloud of uncertainty that was weighing on the market.

The major averages hit their session highs after President Donald Trump indicated he is willing to work with Democrats on policy initiatives that would help the economy keep growing.

The Dow Jones Industrial Average rose 514 points, led by gains in UnitedHealth and Microsoft. The S&P 500 gained 2 percent as the health care, tech and consumer discretionary sectors all rallied more than 2.5 percent. The Nasdaq Composite rose 2.4 percent.

Note: Read our discussion guidelines before commenting.