Democrats won the U.S. House by riding a surge of voter anger and discontent with Donald Trump in suburban enclaves, even as the president’s loyal supporters reaffirmed Republican control of the Senate.

The outcome of Tuesday’s midterm election highlighted the urban-rural divide that has come to define U.S. politics. It will dramatically alter Trump’s next two years in office and make a deeply divided nation even more difficult to govern as he seeks re-election in 2020.

By early Wednesday, Democrats...