Legislation to prohibit discrimination in employment and housing based on sexual orientation or gender identity cleared a first hurdle Wednesday in the Pennsylvania Senate.

The Urban Affairs and Housing Committee vote marked the furthest such anti-discrimination legislation has advanced in the Republican-controlled chamber. The bill has broad support from the business community and liberal lawmakers, but is opposed by social conservatives.

Ted Martin, the executive director of the Harrisburg-based Equality Pennsylvania, which advocates for gay and transgender rights, called the vote "an incredible step in the right direction."

It passed, 7-4, after a brief debate in a packed Capitol hearing room. Proponents defeated an effort, 6-5, to add specific exemptions for religious organizations and religious freedom of conscience that also could have limited which public facilities transgender people could use. Opponents warned it could compromise religious freedoms and personal privacy in places like public bathrooms.

The bill would add the categories of sexual orientation, gender identity or expression to a law that empowers the state Human Relations Commission to investigate complaints of discrimination in employment and housing because of someone's race, sex, religion, age or disability.

The commission can impose civil penalties, such as back pay or damages. A bill prohibiting such discrimination in public services is stalled in a separate committee.

Sen. Wayne Fontana, D-Allegheny, said every Fortune 500 company and 33 municipalities in Pennsylvania have such anti-discrimination policies. It is time for the state to joint them and put "the force of law behind basic human rights and freedoms," Fontana said.

Sen. Mario Scavello, R-Monroe, had sought to add wording spelling out exemptions for religious organizations, as well as some public accommodations, and said he will try again when the bill reaches the Senate floor.

"I want to clarify that you can't just say there's religious freedoms and not explain what they are," Scavello said.

Fontana, however, called Scavello's amendment "unnecessary" and said there is already adequate protection in the bill.

Scavello's defeated amendment addressed the use of shared rooming arrangements - such as in schools, colleges or nursing homes - as well as facilities such as restrooms, showers, locker rooms or dressing rooms.

It would have protected the limitation of the facilities to someone based on "biological sex."

Mara Keisling, the executive director of the Washington, D.C.-based National Center for Transgender Equality, said the result would have been similar to a more sweeping law passed this year in North Carolina, which directs transgender people to use public bathrooms aligned with the sex on their birth certificate.

"It would have been bad," Keisling said. "It would have been a North Carolina thing in Pennsylvania."

The Harrisburg-based Pennsylvania Family Institute, which advocates for conservative social causes, opposed the bill, and said it would undermine rights of conscience, religious freedoms and personal privacy in places like single-sex dormitories and bathrooms.

It also would "force open" private restroom and dressing facilities in workplaces and would prohibit certain religious employers from only hiring those who agree with that religion's beliefs on human sexuality, the Pennsylvania Family Institute said.