A popular federally-funded children's health program that has long enjoyed bipartisan support is locked in an unprecedented state political battle over cutting medical services to transgender youth.

Pennsylvania Senate Republicans want to restrict funding for trans kids to get gender reassignment surgery, also called affirmation surgery. Democrats and LGBTQ advocates are accusing them of playing doctor and discriminating against particularly vulnerable children.

Meanwhile, this ideological tug-of-war is holding up reauthorization of the Children's Health Insurance Program (CHIP), which pays for health care for about 176,000 Pennsylvania children from families with limited incomes.

On Wednesday, the Senate by 37-13 passed a reauthorization bill that would deny CHIP funds for gender reassignment surgery. Other services, like counseling and prescribed puberty-blocking hormones, will be covered by the program. The new amendment is a softening of a version that denied transgender youths access to all of those additional services.

Sen. Don White (R., Indiana), the sponsor of the amendment, posted a statement last week that using state funds to "pay for sex change operations for children" is "completely inappropriate." White said he believes most Pennsylvanians would agree with him.

The Trump administration and other states have been making attempts to limit transgender people's access to publicly funded health care.

LGBTQ advocates and state Democrats – including Gov. Wolf – accused lawmakers of interfering with decisions about what medical care children should receive.

"The amendment effectively segregates transgendered children from how other children in the program are treated," wrote Gov. Wolf to Senate leaders after Wednesday's vote. "Plain and simple, this is wrong, and all health decisions for these kids should be made with their parents, counselors, and doctors – not by politicians."

In a statement issued after Wednesday's vote, Senate Democratic Leader Jay Costa of Allegheny County said it "pained" him to vote against CHIP but said, "I cannot support discrimination."

Omar Gonzalez-Pagan, staff attorney with Lambda Legal, a national LGBTQ civil rights advocacy organization, said the Senate's move could put the state in violation of federal law. He also called the amendment "discrimination against the most vulnerable."

Transgender children, often the targets of bullying and discrimination, tend to be at heightened risk for suicide.

Carrie Jacobs, executive director of the Attic, a Philadelphia-based support center for LGBTQ youth, said obstructing a transgender child's access to appropriate health care "is detrimental, even life-threatening, to the growth and well-being of that child."

Jacobs added: "The Attic firmly believes that … any attempt of lawmakers to obstruct access to medically deemed treatment for transgender youth is rooted solely in discrimination."

Other child health advocates are concerned that the senators' desire to restrict care for transgender youth could hold up or even imperil benefits for the other children who get care through CHIP.

Congress already missed the federal deadline to renew CHIP on Sept. 30. Pennsylvania must reauthorize its part of the national program by the end of this year for its benefits to continue into 2018. A spokeswoman for the Pennsylvania health department said the state program currently has enough funds to last into February.

The state House already approved a bill without transgender limits. The Senate's new bill will now be reconsidered by the House.

Donna Cooper, executive director of Public Citizens for Children and Youth, an advocacy group based in Philadelphia, called it "pretty terrible" that a serious health issue "is becoming a conversation in a political body that has no medical expertise."

Cooper said Pennsylvanians have other formidable health issues, including one of the most serious opioid epidemics in the country.

"Unfortunately, this is what the Pennsylvania legislature is talking about," Cooper said. "This is just a horrible, horrible distraction."