A GOP member of the Texas House went rogue with an anti-immigrant amendment, and it wasn’t pretty.

Sparks flew Wednesday at the state Capitol after a Republican lawmaker tried to score political points by attaching an anti-immigrant amendment to a major bill aimed at reforming the state’s failing child welfare system.

The controversy erupted while members were considering 12 amendments to House Bill 4, which would increase support payments to relatives who take in abused or neglected children. The amendment, by Representative Mark Keough, R-The Woodlands, sought to prevent those payments from going to undocumented family members.

Republicans and Democrats, who have made reforming Child Protective Services (CPS) a priority this session, immediately pushed back against Keough’s amendment. Legislators called the proposal “racist,” detrimental to abused kids and “un-Christian.” Keough is a pastor at The Woodlands Bible Church who has claimed his election to the House was “divine appointment.”

“I am pretty heartbroken to be part of this today,” said Representative Byron Cook, R-Corsicana. “We came here to take care of children. I feel like crying. I really do.”

Representative Rafael Anchia, D-Dallas, accused Keough of using abused children as a political prop.

“I know what you guys campaign on,” Anchia said. “This feels like really racist, anti-Hispanic stuff.”

Keough defended his position, arguing that he wasn’t criminalizing undocumented immigrants, simply refusing them state funds.

“I’m not a racist, I love people, I love the people of my church and I love all of you,” Keough said.

Representative Richard Peña Raymond, the chair of the House CPS workgroup, said he was not consulted about the anti-immigrant measure. The Laredo Democrat said these types of debates should happen “away from the mic” before measures are filed.

Keough’s amendment was eventually withdrawn after receiving no support from his fellow House Republicans, who would’ve been faced with putting the bill’s future in danger or casting a vote that could be used against them in a GOP primary if a record vote had been called.

Kinship care has long been lauded by advocates as a tool to help address the state’s child welfare crisis. Generally speaking, keeping abused and neglected kids with extended family improves their outcomes and saves the state money. Though Keough’s amendment briefly threatened to derail HB 4, the bill was preliminarily approved unanimously by the House.

But the floor fireworks don’t sit well with some lawmakers.

“If we’re starting like this, what the hell is the rest of the session going to be like?” Anchia said.