U.S. stocks rose on Wednesday, with the Dow advancing to a record after the Republican Party took control of the Senate in the midterm elections, as expected, and following a stronger-than-anticipated report on the labor market.

Some weak earnings in the tech sector capped gains in the Nasdaq, but the beaten-down energy sector rallied on hopes a Republican majority could lead to new legislation that impacts the group. That includes approval of oil and gas pipelines and reforms of crude and natural gas export laws.

Energy has lagged recently, suffering massive losses as crude oil prices plunged to a three-year low. The S&P energy index was the only one of 10 primary S&P 500 sectors to be negative for the year, though it rose 1.6 percent as the strongest group of the day.