A Utah bill that bans transgender youth from playing on sports teams that match their gender identity will become law after lawmakers on Friday overrode Governor Spencer Cox's veto.

In vetoing House Bill 11, Cox, a Republican, said that the legislation was flawed and “should be reconsidered.”

The House voted 56-18 in favor of the override, while the Senate voted 21-8. Two Republicans in the House and two in the Senate voted against an override.

House Bill 11 prohibits “a student of the male sex from competing against another school on a team designated for female students.” The legislation defines “sex” as being determined “at birth.”

Cox was the second Republican governor after Indiana Governor Eric Holcomb this month to reject such legislation.

The Human Rights Campaign (HRC), the nation's largest LGBTQ rights advocate, criticized the override vote.

“The Utah legislature shows no shame,” said HRC State Legislative Director and Senior Counsel Cathryn Oakley. “Despite opposition from their own governor, Utah legislators continue to attack transgender children. Further, the state is opening itself up to legal challenges, as have followed similar laws in other states. The Utah legislature should focus on the real issues impacting Utahns, not needlessly attack a handful of vulnerable children who pose no threat and just want to play sports with their friends.”

“We sincerely thank Gov. Cox for seeing the humanity of transgender youth and speaking out against this discriminatory legislation. The Human Rights Campaign condemns this action by the Utah legislature and will continue to use every tool at our disposal to fight for the rights all transgender youth and their families,” Oakley added.

The bill is expected to take effect on July 1.