Democrats took control of the Senate on Tuesday, according to New York Times projections, winning a majority that gives them a stronger position to oppose President Trump’s agenda. They secured the chamber with a victory in Iowa and were also gaining competitive House seats across the country, pointing to a substantial Democratic advantage in that chamber.

The results set the stage for divided government in Washington after two years in which Republicans largely deferred to Trump and the legislative branch played a limited role. The outcome also marked a sharp shift from the start of the election season, when Democrats appeared unlikely to win the Senate or significantly narrow the Republicans’ 53-to-47 majority.

Democrats made gains in Republican strongholds, flipping seats in Kansas, Texas, Ohio, and North and South Carolina. The results came as voters grew more dissatisfied with Trump, amid unrest over the war with Iran and its consequences, rising fuel prices, and tariffs that added to the strain of high living costs. Democrats argued that Republicans in Washington were benefiting while ordinary Americans struggled.

Sources: The New York Times Politics.