A gun store sales associate looks on as a customer tries out a semi-automatic pistol in Las Vegas, Nevada.

The House passed a bipartisan bill to boost gun background checks on Wednesday, starting the most significant push Congress has taken to increase firearms regulations in years.

The legislation, the most significant gun control plan Congress has passed in more than two decades, cleared the Democratic-held House in a 240-190 vote. Eight Republicans supported the measure, while two Democrats opposed it.

Still, the bill likely will not get through the GOP-controlled Senate and past President Donald Trump's veto.

House Speaker Nancy Pelosi pledged to take steps to address gun safety after Democrats gained control of the chamber in January for the first time in eight years. The bill approved Wednesday would require background checks for all firearms sales, including transactions on the internet and at gun shows. Another measure the House plans to pass this week would extend the background check review period to 10 days from three days.

In a tweeted statement after the vote, Pelosi's political team said Democrats "put an end to the Republican obstruction and inaction on gun violence."

Despite some GOP support for the proposals, many Republicans have decried the Democratic push to strengthen gun control laws. Trump has pledged to veto both plans. The White House argues the bills would put an unnecessary burden on gun owners.

Public opinion has moved in favor of tighter gun laws in recent years after a string of high-profile mass shootings, such as the killing of 17 students and staff members at a Florida high school just over a year ago. When they took the majority, Democrats wanted to push for gun control measures with broad public support.

In March 2018, 92 percent of Americans said they favor background checks for all gun sales, according to a Gallup survey.

Following the shooting last year in Parkland, Florida, Trump told survivors of the massacre and family members of victims that he would be "very strong on background checks." Democrats accused him of hypocrisy after he promised to block the legislation that passed Wednesday.

Democrats gained confidence in the issue last year after several candidates won swing House districts while making gun control a priority. Most notably, Rep. Lucy McBath, D-Ga., won a race on the outskirts of Atlanta with gun control as her signature issue. Her 17-year-old son was shot and killed in 2012.

— The Associated Press contributed to this report

Subscribe to CNBC on YouTube.