Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

WASHINGTON — On Wednesday, for the first time in a generation, the U.S. House passed new gun control legislation, by a vote of 240-190.

The legislation — and another bill scheduled for a vote — reflects a confluence of events, including a newly empowered House Democratic majority, the apparently diminishing clout of the National Rifle Association, and the activism of a generation of young Americans following years of deadly school shootings.

The House bill would require background checks on all commercial gun sales, including those at gun shows and over the internet. The bill also had five Republican co-sponsors, led by New York Rep. Peter King, who had tried — and failed — for several years to advance the bill while his party controlled the chamber.

Democrats taking control of the House has “really given it momentum. Hate to admit that, but that’s the reality,” King said in an interview with NBC News.

But other Republicans contend the legislation would have no impact in preventing some mass shootings and that it will ultimately threaten the rights of legal gun owners.

If the two bills became law, Rep. Liz Cheney, R-Wyoming, said at a news conference Tuesday, there would be "a situation where they couldn’t be enforced, ultimately, without a federal gun registry."

Rep. Steve Scalise, R-La., the Republican minority whip who was shot and gravely injured at a congressional baseball practice in 2017 added: “It’s one more step towards federalized gun registration and ultimately gun confiscation.”

King said that argument “just isn’t true.”

“We’re talking about the person who is a criminal, the person who has a history of mental illness,” he said, noting his party is out of step even with most gun owners.

Since the bill faces an uphill fight in the Republican-run Senate, the House leadership has arranged for a separate vote Thursday on a more modest measure that may be able to attract greater bipartisan support.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

That bill would close the so-called “Charleston loophole,” which allows the sale of a firearm to proceed if a background check is not completed within three days. It’s a loophole that allowed Dylann Roof to obtain his weapon with which he murdered nine people at the Emanuel AME Church in Charleston, South Carolina, in 2015. Had the FBI background check been completed, he would have been blocked because it would have been revealed that he had previously admitted to drug possession.

The effort to close that loophole is the first test of the new Democratic leadership’s ability to advance a few modest legislative goals capable of garnering bipartisan support in both chambers of Congress, aides say.

In the Senate, Democrats are hoping to pressure Republicans, including Tim Scott of South Carolina and Cory Gardner of Colorado — another state rocked by mass shootings — to align themselves with the measure and lean on McConnell to bring it for a vote.

President Donald Trump has vowed to veto the current legislation, and many advocates remain skeptical that Senate Majority Leader Mitch McConnell, R-Ky., will bring it up for a vote.

The two bills represent the first gun safety efforts expected to pass the House since the Brady Handgun Violence Prevention Act of 1994 mandated federal background checks on firearm purchases in the United States.

Much has changed in the world of gun sales since then — the law doesn’t cover sales over the internet and at gun shows, meaning there are gaping holes in the nation’s legal gun purchasing system.

While the current divided Congress makes it unlikely that any significant gun safety efforts will pass anytime soon, advocates say it’s an effort worth making.

“At least one body of Congress is willing to do what many Americans are asking for … and then build towards bold policies that we really need to reduce gun deaths,” said Igor Volsky, executive director of Guns Down America, a grassroots advocacy group that says it is “taking on” the NRA.

The 2018 midterm election marked a turning point of sorts, with pro-gun control groups increasing their political muscle.

For the first time, groups like Everytown for Gun Safety and Giffords PAC, founded by former Arizona Democratic Rep. Gabby Giffords -- who was shot and seriously wounded by a would-be assassin in 2011 -- spent at least $13 million at the state and federal levels in the midterms.

That figure is $2 million more than gun rights groups including the N.R.A. spent, according to the Center for Responsive Politics.

Television ads run by Everytown for Gun Safety highlighting the need for tougher gun laws increased 22 fold from four years ago, according to a Wall Street Journal analysis. In tossup House races, 93 percent of gun-related ads favored stricter gun measures, the Journal analysis found.

Many of the candidates who ran openly on a platform to curb gun violence won, even in traditionally Republican areas like Texas. For instance, of the 307 federal and local candidates Giffords endorsed, 256 were victorious. They also include new members such as Lucy McBath of Georgia, who lost her son, Jordan Davis, in 2012.

Activists say that wider public support for broadening background checks, with 90 percent approval in Gallup and other major polls, along with the coming of age of a generation of children born into a culture of school shootings that began with the 1999 massacre at Columbine High School in Littleton, Colorado, has shifted the activism intensity to the side of gun control.

Sam Zeif, 19, lost a friend in the mass shooting at the Marjory Stoneman Douglas High School in Parkland, Florida, last year. Zeif said that following the shooting, the school’s students and parents created new gun safety groups, including March for our Lives and Change the Ref. They have held town halls, arranged demonstrations, called congressional offices and arranged petitions while coordinating with parents from Columbine and Sandy Hook in Newtown, Connecticut, where 20 children as young as six lost their lives in a mass shooting in 2012.

“It wouldn’t be the same without everyone’s contribution,” Zeif said. “Somebody had to do it. It just happened to be us,” he said.

Sponsors of the legislation being voted on Wednesday also credited activism by the Parkland students as a critical factor in building momentum. “It’s the accumulation of tragedies over the years, personified by Parkland,” King said.

“Every day, there’s a group of young people up here campaigning for expansion of background checks,” Rep. Mike Thompson, a California Democrat who is co-sponsoring the broad background check bill, added.