“If the president or the Senate chooses not to support it, frankly, it’s on them,” she added, “but we have to try and we have to continue to try until we get it done.”

Gun safety marches and a new breed of advocates — most prominently, March for Our Lives, the movement led by the teenage survivors of the shooting at a high school in Parkland, Fla., — bolstered young voter turnout. Around two dozen candidates supported by the gun lobby were defeated on Tuesday, according to Giffords PAC, the gun safety group run by former Representative Gabrielle Giffords, who was shot in the head in a mass shooting.

“We cannot let these tragedies become our new normal,” said Colin Allred, an incoming freshman Democrat who ousted a veteran Republican, Pete Sessions, in the suburbs north of Dallas. “I think we need to find a way to work together to find some real solutions to reduce gun violence, consistent with the Second Amendment.”

But a handful of other Democrats, including Representative Conor Lamb of Pennsylvania, a former Marine who favors gun rights, have cautioned the party against any legislative package that would curtail gun owners’ ability to obtain firearms. And winning Democrats in districts like suburban Charleston, S.C., and Oklahoma City will have to be mindful of their fragile mandates — especially if any House legislation is destined to die in the Republican-controlled Senate or at President Trump’s desk.

Some incoming freshmen are warning against overpromising or politicizing a tragedy.

“As Democrats, we should not try to make this a political issue that is about gun legislation because any of the gun legislation we’re advocating for would not have prevented this,” said Katie Hill, who defeated Representative Steve Knight in a California district near Wednesday’s shooting. “We lose credibility if we try to make it as if it would’ve,” she added.

The gunman, a former Marine, bought his handgun legally in a state with some of the toughest gun control laws in the country.