A Republican-backed motion to block the Equality Act, which would provide civil rights protections to gay and transgender people, failed on Friday as the House of Representatives voted to approve the bill, 236 to 173.

The bill had the support of every Democrat in the House, along with eight Republicans. If it also passes in the Senate, President Trump is expected to veto the measure when it reaches his desk.

The new anti-discrimination legislation would ensure that LGBTQ individuals cannot be discriminated against on the basis of sexual orientation or gender identity, bringing everyone "closer to equal liberty and justice for all," said House Speaker Nancy Pelosi, a champion of the bill.

Republicans have pushed against the sweeping piece of legislation, known as HR 5, saying it endangers freedom of religion by requiring every citizen to accept the changing definitions of sexual identity in society.

MORMON CHURCH OPPOSES LGBT NONDISCRIMINATION MEASURE

Another concern is that the bill will impede the civil liberties of women and girls.

Republicans also introduced a motion to recommit on the House floor Friday, calling on lawmakers to deny transgenders the right to take part in single-gender sports activities to avoid biological disadvantages between men and women. Republicans are concerned Title IX, a law that ensures federally-funded education programs do not segregate on the basis of sex, could be endangered by the new legislation.

“Democrats are attempting to erase the decades of progress women have achieved in athletics programs,” House Minority Leader Kevin McCarthy told Fox News on Friday. “Protecting Title IX shouldn’t be partisan. Democrats denied girls and women their own space in sports and demonstrated another way they want to politicize every aspect of Americans’ lives.”

“Essentially, the reason Title IX was even created was to give girls and women a separate space to compete, but HR 5 allows men and boys to compete on women’s sports teams, use their locker rooms, etc.” McCarthy’s office said in a statement.

According to a Rasmussen poll from April, only 23 percent of voters “believe a person born as a male but identifying as a female should be allowed to compete in women’s competitive sports events.”

GOP lawmakers insist that the Equality Act would be the “end to women’s only sports.”

“Transgender women and girls are already allowed to participate in sports programs – this bill is simply an attempt to politicize a non-political entity,” McCarthy said.

Still, Democrats rejoiced at the win, with 2020 presidential candidate Beto O’Rourke praising lawmakers for passing the bill.

“Our thanks to the advocates, activists, and LGBTQ champions across the country who lead the way each day, kept the march for justice going year after year, and ultimately passed the Equality Act in the House today. Together, we will secure full civil rights for LGBTQ Americans,” O’Rourke tweeted.

CLICK HERE FOR THE FOX NEWS APP

The eight House Republicans who voted for the bill Friday were Reps. Susan Brooks of Indiana, Mario Diaz-Balart of Florida, Brian Fitzpatrick of Pennsylvania, Will Hurd of Texas, Greg Walden of Oregon and New York lawmakers John Katko, Tom Reed and Elise Stefanik.