Gay-rights advocates said the move was a long time coming. They said Phoenix, the sixth-largest city in the country, is playing "catch-up" with at least 166 other U.S. cities and counties that have adopted similar laws.

An estimated 500 people packed the Orpheum Theatre, and dozens of people spoke on both sides of the issue. Many supporters wore "yes" stickers and rainbow pins.

"I'm here to convince you to be on the right side of history today," Dale Heuser, president of the gay-rights group Equality Maricopa, told the council. "This is a basic human-dignity issue."

The issue lit up Twitter, with one observer calling the meeting "the longest, most intense, and in the end, the most inspiring show ever seen at the Orpheum."

Once it became clear the reforms had passed, supporters jumped to their feet and erupted in applause. Some local longtime gay-rights leaders hugged, reflecting on their victory 21 years after city leaders shot down a similar proposal.

Mayor Greg Stanton fast-tracked the reforms, which ban discrimination on the basis of sexual orientation and gender identity or expression - those who identify as a different sex than they were born as.

The changes approved Tuesday would prohibit discrimination in housing, employment and public accommodations, such as restaurants and hotels. Businesses and individuals that don't comply could be criminally prosecuted and face a misdemeanor charge, punishable by a $2,500 fine.

Phoenix now offers few such safeguards for gay people but bans discrimination based on race, sex, religion, national origin, age and marital status.

Ultimately, council members approved the changes 5-3, with the majority saying Phoenix would benefit from projecting an image that it welcomes diversity.

Opposition to the proposal has intensified in recent days, with some religious and conservative business leaders raising concerns that it would create a regulatory burden for small businesses or allow transgender men to share public bathrooms with women. They had labeled it the "Bathroom Bill."

"This is a significant extension of city policy," Cathi Herrod, president of the conservative Center for Arizona Policy, said in pushing for the council to table the issue. "We have many questions that go beyond the bathroom issue."

However, Herrod also cited language in the ordinance that included public accommodations.

"How does that not include bathrooms?" she asked.

Councilman Sal DiCiccio and other critics also questioned whether religious organizations would be fully exempt from criminal penalties attached to the law. He has said the public was "purposely misled" on that aspect.

In response to those fears, the council amended the law to clarify that religious groups are exempt, meaning they can exclude gay and transgender residents because of their religious principles. City officials had different interpretations about whether an earlier version would have allowed churches to exclude transgender people.

Supporters said the bathroom issue had become a red herring.

Several council members pointed to other major cities and counties they said had similar laws, such as Salt Lake City, Philadelphia and Denver, saying expanding civil-rights protections to gay residents has not created problems.

Emotions on both sides escalated throughout the evening.

When a father brought up his fear of the law unleashing sexual predators in bathrooms, someone in the audience yelled an expletive at him. Several times, the crowd booed DiCiccio when he said the ordinance vote was being rushed.

Tom Simplot, the city's first openly gay elected official, said Phoenix has not been a leader on the issue, merely catching up with public opinion.

Other cities and corporate America began favoring gay-friendly policies many years ago, he said.

"With all due respect, those may have been valid arguments back in 1977," Simplot told opponents concerned about the effect on small businesses. "They're not valid today."

Many residents told the council they often have faced discrimination in Phoenix:

A lesbian schoolteacher said she left her job after a principal demanded she not "out" herself to students.

A transgender woman said she had been evicted from her apartment.

A gay man said he had recently been fired from his job.

Phoenix's existing ordinance, approved in 1992 as a compromise on broader protections, prohibits workplace discrimination against gays and lesbians who work only for the city or at companies that have city contracts and at least 35 employees.

The council shot down broader civil-rights protections for gays and lesbians.

Phoenix's ordinance still includes exemptions for religious organizations, small private landlords, senior housing and private clubs, among others.

The council also approved changes outlawing discrimination against disabled residents in the areas of employment and public accommodations. Federal law gives protections to the disabled in those areas, so the ordinance would not have as much effect on them.