Legislators in Puerto Rico on Friday approved a heavily debated bill that outlaws employment discrimination based on gender or sexual orientation.

Opponents of the bill prayed on the steps of the seaside Capitol building as lawmakers voted on a simplified version of the measure, which was widely rejected by religious organizations in the conservative U.S. territory.

The original version was broader and would have also banned such discrimination when it comes to commercial transactions, property rentals and public transportation, as well as in other circumstances. About half of U.S. states have approved similar bills.

The measure's author, Sen. Ramon Luis Nieves, told reporters he is not bothered that the original version was not approved.

"This is not insignificant," he said. "This is a great victory in the fight for human rights in Puerto Rico."

Legislators on Friday also approved a separate bill that extends a domestic violence law to gay couples.

Both bills are to go back to the Senate, which is expected to approve them. The governor has said he would sign both measures.

Supporters of the bill waved rainbow flags and loudly chanted "Equality!" as they crowded around legislators who approved the bills.

"A decade ago, (we) were criminals under a sodomy law. Today, we're second-class citizens," said Pedro Julio Serrano, spokesman for the U.S.-based National Gay and Lesbian Task Force. "When this measure becomes law, we will be closer to obtaining the first-class citizenship we deserve."

The new measures come as the U.S. territory begins to debate gay rights more seriously in the Caribbean region, where sodomy laws and harassment of gays is common.

Earlier this year, Gov. Alejandro Garcia Padilla signed an order extending health insurance coverage to the domestic partners of workers in his executive branch of government, regardless of gender. The island's Justice Department also is prosecuting its first hate crime case for the killing of a hairstylist who was set on fire.

But the push toward more gay rights in Puerto Rico remains widely debated.

The island's House of Representatives approved the anti-discrimination bill 29-22 after a 10-hour debate that ended overnight Thursday without a consensus.

The proposal did not have full support from the governor's Popular Democratic Party, which controls the island's House and Senate. The governor had met with members of his party late Thursday and urged them to vote for the bill.

"The country has a social obligation, a historic obligation and also a Christian obligation to fight all types of discrimination," he said.

The island's Senate approved the original measure 15-11 last week, but the House of Representatives sought to changes in the bill.

Rep. Javier Aponte Dalmau was among those who opposed the measure. He said all types of discrimination are wrong, but considered the original bill's wording to be too far reaching, and there are other judicial means to address potential discrimination.

Other legislators voted against the measure saying they believe the island's Constitution already addresses discrimination.

A local Christian organization, Puerto Rico for Family, said the bill was unnecessary because the gay and lesbian community has not proved it faces greater employment discrimination than other groups.

"This law creates a base to promote homosexuality and other conducts in schools," the organization said in a statement.

Most government agencies in Puerto Rico already have their own anti-discriminatory policies, but human rights activists say they are often not enforced.