The passionate gun control rallies Saturday that brought out large crowds around the country sent a vivid signal that the issue is likely to play a major role in the 2018 midterm elections, and that Republicans could find themselves largely on the defensive on gun issues for the first time in decades.

The gun debate could play out very differently in House and Senate races, as Republicans strain to save suburban congressional districts where gun control is popular, and Democrats defend Senate seats in red states where the Second Amendment is sacrosanct.

But, in a year of extraordinary political intensity, and in the first national election of the Trump presidency, Republican and Democratic leaders say the gun issue appears to have become a potent rallying point for voters opposed to Mr. Trump and fed up with what they see as Washington’s indifference to mass shootings. The scale of demonstrations over the weekend was reminiscent of the Women’s March, earlier in Mr. Trump’s presidency, and underscored the intense energy of activists on the left ahead of the fall campaign.

The commitment of the young march organizers to keep the issue front and center makes it unlikely to fade before November. But they are certain to face considerable resistance from pro-gun forces, particularly the National Rifle Association, which has formidable financial resources at its disposal and a long record of successfully mobilizing conservatives and helping win elections.