LOS LUNAS, N.M. — The tumultuous 2018 midterm campaign, shaped by conflicts over race and identity and punctuated by tragedy, barreled through its final weekend as voters prepared to deliver a verdict on the first half of President Trump’s term, with Republicans bracing for losses in the House and state capitals but hopeful they would prevail in Senate races in areas where Mr. Trump is popular.

The president was set to storm across two states Saturday, two Sunday and three Monday in an effort to pick off Senate seats in Indiana, Florida and a handful of other battlegrounds where Republicans hope to add to their one-seat majority in the chamber. Democrats and liberal activists, galvanized by opposition to Mr. Trump, gathered Saturday to knock on doors and make turnout calls from Pennsylvania to Illinois to Washington to try to erase the G.O.P.’s 23-seat House majority.

The run-up to the election, widely seen as a referendum on Mr. Trump’s divisive persona and hard-line policy agenda, has revealed deep strains in the president’s political coalition and left him confined to campaign in a narrow band of conservative communities. Republicans’ intermittent focus on favorable economic news, such as the Friday report showing strong job growth, has been overwhelmed by Mr. Trump’s message of racially incendiary nationalism.

While Mr. Trump retains a strong grip on many red states and working-class white voters, his jeremiads against immigrants and penchant for ridicule have proved destabilizing, with the party losing more affluent whites and moderates in metropolitan areas key to control of the House.