Forty-two House Democrats bucked party leadership on Thursday to pass an amendment ensuring that individuals convicted of sex crimes, terrorism, and other violent offenses cannot be employed by the TSA.

Despite their support for the #MeToo movement against sexual misconduct, 174 House Democrats voted against an amendment to the Rights for Transportation Security Officers Act that alters the way TSA disciplines and fires workers. The amendment divided Democrats on Thursday despite the fact that it was written by Democratic Rep. Lauren Underwood (Ill.). House Minority Leader Kevin McCarthy (R., Calif.) criticized liberal lawmakers for attempting to sabotage efforts to safeguard the public from sexual predators.

"[The amendment] was pulled back by leadership because the socialist wing of the party did not want to have that amendment go forward on this bill," McCarthy said on Thursday. "When it was offered, overwhelmingly the majority of the House would like to see the TSA not hire terrorists or those who have been convicted of sexual misconduct with minors and others. But the socialist wing of the party, that controls now the Democratic Party, said that that could not be offered."

Republicans were able to include the amendment in the bill only after Underwood and 41 other Democrats broke ranks to insert the language into the bill in a 227-175 vote. Reps. Alexandria Ocasio-Cortez (D., N.Y.), Ilhan Omar (D, Minn.), Rashida Tlaib (D., Mich.), and Ayanna Pressley (D., Mass.), as well as House Majority Leader Steny Hoyer (D., Md.), all voted against Underwood's amendment when Rep. Debbie Lesko (R., Ariz.) put it forward in a motion to recommit—the last opportunity for a House bill to be amended before a final passage vote. House Speaker Nancy Pelosi (D., Calif.) did not vote on the motion. A top Republican aide criticized Democratic leaders for bowing to party leaders on the measure.

"It's no surprise that Democrat logic in 2020 means taking marching orders from Justice Democrats to give TSA the ability to hire the Harvey Weinsteins of the world," the aide said. "A ‘second chance' for sex offenders shouldn't include patting down traveling families."

Pelosi did not respond to a request for comment on why the amendment was pulled, nor did Underwood. Ocasio-Cortez, Omar, Tlaib, Pressley, and Hoyer did not respond to requests for comment about the bill.

Lesko argued in favor of the amendment by highlighting troubling examples of sexual misconduct by TSA screeners, including a Los Angeles screener who used fraud to falsely imprison and unclothe a woman going through security.

"Fortunately, this offender was immediately fired by the TSA. However, under this bill … this predator could be on the federal payroll for months or even years," Lesko said. "We have two options today: Adopt the Underwood amendment and keep sexual predators off of the federal payroll, or reject it and reward sexual predators with a paycheck from the taxpayer."

Though Rep. Val Demings (D., Fla.) argued against the amendment by calling it unnecessary, 42 Democrats voted in favor of it, including Underwood. Demings did not respond to a request for comment.

When the TSA was created in the aftermath of the 9/11 terror attacks, Congress exempted it from salary and workplace policies—known as Title 5—that apply to other federal workers in order to ensure flexibility. TSA workers unionized under the American Federation of Government Employees (AFGE) in 2011 and organizers have lobbied Congress to end the exemption, which would lead not only to pay increases for workers, but increased dues for union coffers.

AFGE hailed the passage of the Rights for Transportation Security Officers Act as a "huge win for the hardworking women and men who risk their lives to ensure we reach our travel destinations safely." An AFGE spokesman said the union took no position on Lesko's amendment, though it has previously invoked #MeToo to decry budget cuts at other agencies.

A powerful fixture in Democratic politics, AFGE has already spent nearly $1 million on the 2020 election, with 95 percent going to Democrats. It has made the bargaining power of TSA workers a central point in determining its 2020 endorsements; both Sen. Bernie Sanders (I., Vt.) and former vice president Joe Biden pledged to end the agency's exemption to Title 5 if elected president in an AFGE questionnaire. President Donald Trump announced that he plans to veto the bill if it advances past the Senate.