The Anchorage, Alaska Assembly passed a gay protections bill Tuesday evening, CBS affiliate KTVA reported.

The bill, approved in a 7 to 4 vote, bans discrimination on the basis of sexual orientation and gender identity (transgender protections) in the areas of employment, housing and credit. Lawmakers agreed to a compromise that exempts religious organizations from the regulations.

Final passage came after months of debate and numerous revisions. One draft turned the bill on its head, allowing discrimination based on sexual orientation, while protecting other classes.

Hundreds of opponents piled in to testify against the bill in June, stalling lawmakers from voting on the measure until after Republican Mayor Dan Sullivan was installed on July 1. Sullivan's veto, however, is not a foregone conclusion.

The mayor said Wednesday he would consider the measure.

“I understand that Anchorage residents want to hear from their mayor regarding the Assembly ordinance that passed last night,” Sullivan said in a statement.

“This issue is important to our community and, as such, deserves careful consideration. It is my responsibility not only to listen to constituents but to examine the ordinance's language in depth.”

Sullivan said he was currently consumed by a $9 million shortfall in the city's budget, but would make an announcement soon. He has seven days to veto the measure.

Opponents say if Sullivan does not veto the measure, they're prepared to force a vote on the issue.

“If the mayor should not veto this and it should become law, we can take it to the people,” Dr. Jerry Prevo of the Anchorage Baptist Temple told the station. “And get it on the ballot and I think people will vote it down like they have in the past.”

Foes say they object to the measure based on religious grounds. Some testified that the ordinance will lead to gay marriage, which they oppose.

Meanwhile, opponents of a similar gay protections ordinance passed by Kalamazoo, Michigan city leaders have managed to force a public vote on the issue after qualifying a petition.