The House of Representatives voted 281-140 on Wednesday evening to approve an annual defense policy bill, the National Defense Authorization Act, that for the first time protects children of members of the military from irreversible transgender medical interventions.

“We should not be funding this with our military,” Rep. Greg Murphy, R-N.C., told The Daily Signal. “We should be funding our military to keep the nation safe and secure.”

The $895 billion National Defense Authorization Act includes a prohibition on the use of taxpayer funds for gender transition procedures for children who get their medical care through the military’s health care program.

It prevents TRICARE, the military’s health care program, from covering specific treatment: “Medical interventions for the treatment of gender dysphoria that could result in sterilization may not be provided to a child under the age of 18.”

This is the first instance of such a restriction being enshrined in federal law.

President-elect Donald Trump has promised to ban such transgender medical treatments for children without parental consent.

Many progressive Democrats said they wouldn’t support the bill because of the ban on taxpayer-funded transgender medical procedures.

“Blanketly denying health care to people who clearly need it, just because of a biased notion against transgender people, is wrong,” Rep. Adam Smith, D-Wash., said in a public statement Sunday.

Murphy said Democrats such as Smith and Rep. Seth Moulton, D-Mass., who refused to advance the bill due to “ideological riders,” are risking national security.

“It’s unfortunate that they literally put to risk the security of the nation over a social justice issue that I think has really so many flaws as far as its appropriateness,” Murphy said.

Murphy, a medical doctor, said it’s “ridiculous” to allow children with undeveloped prefrontal cortexes to make permanent changes to their bodies through surgeries and medications. He said this isn’t something the U.S. military should be endorsing.

“We’re trying to deal with the defense and security of our country,” Murphy, co-chair of the GOP Doctors Caucus, told The Daily Signal, “and we’re dealing with a social justice issue.”

Not every GOP lawmaker is on the same page, however.

Rep. Mike Rogers, R-Ala., told The Hill that he doesn’t think the National Defense Authorization Act, or NDAA, should include such a provision.

House Speaker Mike Johnson, R-La., “didn’t talk to me about it,” Rogers said.

“My preference would have been that we just let the president, on Jan. 20, deal with these, which he’s already indicated he’s going to do,” the Alabama Republican said.

Passage of the NDAA with the contested provision comes as the Supreme Court considers whether states may ban transgender medical procedures for minors. In U.S. v. Skrmetti, the high court is expected to decide the constitutionality of a Tennessee law protecting kids from transgender medical interventions—sterilizing puberty blockers, hormone replacement regimens, and irreversible transgender surgeries.

In a video last year, Trump, who takes office again Jan. 20, promised to “pass a law prohibiting child sexual mutilation in all 50 states.”

“The left-wing gender insanity being pushed at our children is an act of child abuse,” Trump said. “Very simple. Here’s my plan to stop the chemical, physical, and emotional mutilation of our youth.”