In a 9-2 vote, the Anchorage Assembly late Tuesday night made it illegal in the city to discriminate over sexual orientation or gender identity.

The new local civil rights ordinance, the first of its kind in Alaska, will take effect as soon as it is signed by Assembly Chair Dick Traini, with the Assembly rejecting an amendment to require a public advisory vote in April.

Mayor Ethan Berkowitz said he does not plan to veto the ordinance, which was co-authored by Assembly members Bill Evans and Patrick Flynn and passed shortly before midnight Tuesday. The ordinance adds protections to Anchorage equal rights laws for gay, lesbian, transgender and bisexual people in housing, employment and public accommodations and includes exemptions for religious groups and those with ministerial duties.

In a joint statement released immediately after the Assembly vote, the organizations Alaskans Together for Equality, the American Civil Liberties Union of Alaska, Identity Inc., the Pride Foundation and the Human Rights Campaign praised the ordinance and the efforts of Evans and Flynn. Evans usually votes with the Assembly's conservative bloc, and Flynn usually votes with the liberal bloc.

"With today's passage of a strong and fair nondiscrimination ordinance through the Anchorage Assembly, we have taken yet another step toward living up to the Alaskan values of fairness and treating others as we would want to be treated," the statement said. "We have joined the vanguard of over 200 cities that say you should not be fired or lose your home simply based on who you are or whom you love."

Opponents of the ordinance said they plan to pursue a referendum to repeal the law. During the meeting, people were signing their names, addresses and contact information onto red and white cards to indicate opposition.

The Rev. Jerry Prevo of the Anchorage Baptist Temple said after the meeting he was surprised that the ordinance passed the Assembly by such a large margin.

"Tonight we have nine Assembly members that apparently didn't care what 57 percent of voters wanted, and voted their way, and told 57 percent of the population of Anchorage they don't care," Prevo said, referencing the margin by which voters rejected a 2012 ballot measure on an Anchorage LGBT anti-discrimination law.

Assembly members Amy Demboski and Bill Starr, both of Chugiak-Eagle River, were the two "no" votes on the ordinance.

Traini said he expects to sign the measure Friday. An Assembly member could also file a motion for reconsideration with the clerk's office within 24 hours. But once it's signed by Traini, the measure will be effective immediately.

In 2009, the Assembly voted 7-4 to approve a similar ordinance. Mayor Dan Sullivan vetoed it a week later.

Berkowitz called the Assembly's Tuesday vote a "clear expression."

"What you see, I think, from my perspective, moves us toward a more just society," Berkowitz said after the meeting. "But it also has important benefits about making Anchorage a more attractive place for people to live and work."

The Assembly heard two consecutive nights of emotional public testimony from both sides of the issue earlier this month. On Tuesday night, Assembly members spent about three hours debating the Evans-Flynn ordinance, even taking the unusual step of extending the meeting until midnight. Much of the debate was impassioned and centered on a package of 17 proposed amendments, many of which focused on rules for gender-segregated restrooms and on expanding the scope of religious exemptions.

In the end, only two were approved: a Flynn amendment stating that nothing in the law would trump state and federal First Amendment rights, and an Evans amendment adding a reference to a Supreme Court case, Hosanna-Tabor Evangelical Lutheran Church and School vs. EOCC, to define a "ministerial exemption."

The Assembly narrowly rejected Assembly Chair Dick Traini's proposals to extend the city's existing religious preference law to "nonprofit affiliates," such as Providence Alaska Medical Center, and to add language that would prevent employers from firing employees for expressing religious views.

None of the six amendments proposed by Assembly member Amy Demboski ultimately passed. Most of her amendments sought to expand religious exemptions.

The Assembly also reversed itself on a Demboski amendment to allow business operators to segregate restrooms or locker rooms based on a person's male or female anatomy. The amendment initially passed 6-5, but Assembly members Tim Steele and Pete Petersen later changed their votes. The adopted version of the ordinance states that business operators can provide gender-segregated locker rooms, restrooms or dressing rooms, as long as people can use the facilities consistent with their gender identity.

In charged speeches, Demboski said the ordinance represents government infringement on religious liberty.

"This is the tyranny of the Anchorage Assembly," Demboski told the audience just before the vote. "You can only take it back. Get out to vote."

She also said she hasn't seen evidence of "rampant" discrimination in Anchorage. Assembly member Tim Steele countered by saying that surveys and documents had been published documenting discrimination in the city.

"It's not rampant … to deny it exists is just wrong," Steele said.

Assembly member Elvi Gray-Jackson, who was quiet for most of the debate, spoke up at the end to say she did not think a public vote should take place.

"For me, as a black woman, to have the rest of this community vote on whether or not I could have equal rights is just wrong," Gray-Jackson said.

Starr also spoke passionately against the ordinance. In the middle of his final speech, Starr pulled out a red vest and walked down to the microphone where citizens usually gives testimony during hearings. He got a standing ovation from the ordinance's opponents, who were also wearing red, as he talked to his colleagues at the microphone.

"Legislation by trial and error, Mr. Flynn, is very dangerous," Starr said, looking up at the dais. "And Mr. Evans, if you can say that nothing's happened, and I hope it doesn't happen, that's all well and good -- but I'll venture to say right now that things have already happened. We've divided our community. These folks in red are here to make sure we do our job."

Evans asserted earlier in the debate that the adverse effects claimed in emails by opponents, such as lawsuits against churches and predators entering bathrooms and locker rooms, would not transpire. He said if the ordinance passed, Anchorage would not see the "dire and apocalyptic" efforts being predicted.

But Evans said he does expect that, "one way or the other," the issue will go back before voters in the city's April election.