Washington — The House on Tuesday adopted a resolution to denounce socialism "in all its forms" in a political messaging exercise ahead of the November elections.

The House adopted the resolution in a 220 to 192 to 2 vote, with eight Democrats voting with all Republicans in favor. Two Democrats voted present.

The Democrats who supported the resolution included Reps. Kathy Castor of Florida, Henry Cuellar of Texas, Don Davis of North Carolina, Jared Golden of Maine, Vicente Gonzalez of Texas, Marie Gluesenkamp Perez of Washington, Darren Soto of Florida and Gabe Vasquez of New Mexico.

Those who voted present were Reps. Chrissy Houlahan of Pennsylvania and Maggie Goodlander of New Hampshire.

GOP leaders scheduled the vote after Democratic primary voters embraced a number of democratic socialist candidates. Republicans connected those wins to their own push to pass President Trump's signature voting regulations bill, the SAVE America Act.

The resolution also reaffirms their support for the legislation that has been stalled for months in the Senate, where it lacks even a simple majority support.

"Not only do we denounce socialism, but also the idea of people that aren't American citizens voting in our elections, because that's part of their platform," House Majority Leader Steve Scalise, a Louisiana Republican, said Tuesday of the Democratic Socialists of America.

A small handful of congressional Democrats identify as democratic socialists, including Rep. Alexandria Ocasio-Cortez of New York, though several candidates aligned with the movement have won primaries in recent months, with Darializa Avila Chevalier of New York and Melat Kiros of Colorado defeating incumbent Democrats.

The vote nearly didn't come to fruition as a handful of Republican hardliners voted "no" in a party-line procedural vote earlier Tuesday to tee up the resolution and other related measures for final passage. The protest votes stemmed from their issues with a short-term government funding bill.

But two moderate Democrats — Golden and Gluesenkamp Perez — defected and helped the procedural vote succeed, putting some of their Democratic colleagues in a politically tricky situation.

House Democratic leadership condemned Golden and Gluesenkamp Perez's decision later Tuesday.

"The decision by two of our colleagues to blindside the entire House Democratic Caucus and join with the Republican majority to pass a procedural rule on the brink of failing represents a significant breach of trust. It is an action that necessitates a serious response, and we have asked the Committee on Caucus Rules to take this up in short order," House Minority Leader Hakeem Jeffries said in a joint statement with House Minority Whip Katherine Clark and Democratic Caucus Chair Pete Aguilar.

Aguilar noted prior to the vote that some Democrats have put forth a separate resolution on condemning socialism that removes the statement of support for the SAVE America Act.

"We're capitalists. We believe in a capitalist system and rules and laws," the California lawmaker said Tuesday morning. "But what Republicans are seeking to do here is to just add in another talking point where they can talk about the SAVE Act."

In a statement ahead of the vote, Jeffries said he would vote against the resolution because of the SAVE America Act inclusion.

"House Republicans continue to desperately push toxic voter suppression legislation instead of working to make life more affordable for everyday Americans in the midst of a searing cost-of-living crisis. House Resolution 1490 explicitly calls for enactment of the so-called SAVE America Act, which is the top legislative priority of far-right extremists," the New York Democrat said.