SALT LAKE CITY — Salt Lake City has the seventh-highest percentage of adults who identify as lesbian, gay, bisexual or transgender among the nation's top 50 metropolitan areas.

An analysis of Gallup survey data released Friday shows 4.7 percent of adults in Utah's capital city consider themselves LGBT. San Francisco ranked highest at 6.2 percent, while Birmingham, Alabama, ranked lowest at 2.6 percent.

Salt Lake City's place in the top 10 — that includes six cities in the West — might seem surprising because Utah is one of the most conservative states in the nation. It's also home to The Church of Jesus Christ of Latter-day Saints, which teaches that marriage is between one man and one woman.

"I don't think it's surprising to the gay community here," said Kent Frogley, Utah Pride Center board chairman.

Meantime, Gov. Gary Herbert on Friday signed the second of two bills dealing with nondiscrimination and religious freedom.

Utah's LGBT and Mormon populations are intertwined. Many who identify as gay or transgender grew up in LDS families. Members of the LDS faith have LGBT family members, co-workers and friends.

LGBT people who were reared in a Mormon home or environment but are no longer practicing the faith still feel comfortable in Salt Lake City, Frogley said.

The city also attracts LGBT people from surrounding largely rural states that don't have big metropolitan areas and aren't as tolerant, he said.

Salt Lake City is an island of liberalism where the mayor has flown the rainbow flag at the City-County Building. It also annually hosts a large Pride parade and festival.

"Salt Lake City has been very proactive and progressive in LGBT rights," said Pam Perlich, a senior research economist at the University of Utah's Bureau of Economic and Business Research. "We're known in Salt Lake as a welcoming place."

In 2009, the city approved an ordinance prohibiting landlords and employers from discriminating based on sexuality, which the LDS Church supported.

Frogley said the LGBT Utahns are more cohesive and galvanized than in other similarly sized cities because they've had something to push against to help bring about recognition and equality. At the same, he said, opposing sides can talk things out.

Earlier this month, the LGBT community, state lawmakers and the LDS Church came together on watershed legislation combining nondiscrimination and religious rights.

SB296, which Herbert signed last week, adds sexual orientation and gender identity to Utah's anti-discrimination laws for housing and employment, clarifies exemptions for religious institutions and their affiliates and provides protections for religious expression.

A second bill, SB297, requires county clerks' offices to marry any couple that qualifies for a marriage license. It also includes protections for religious beliefs, exercise and conscience and prohibits retaliation for expressing those views outside the workplace. The governor signed the measure Friday.

Herbert also signed a legislative resolution declaring Jan. 16 each year as Religious Freedom Day in Utah.

Even though not everyone agrees with every element of the legislation, it helped recast the tone of the conversation and is a huge step forward, Frogley said.

The Galllup poll results are based on responses to the question, "Do you, personally, identify as lesbian, gay, bisexual or transgender?" It includes more than 374,000 Gallup Daily tracking interviews conducted between June 2012 and December 2014.

It is the largest ongoing study of the distribution of the LGBT population in the U.S., and the first time a study has had large enough sample sizes to provide estimates of the LGBT population by metropolitan area.

Perlich said it's important to note that the poll doesn't measure how many LGBT people live in the city, but how many identified themselves that way. The numbers could actually be higher, she said.

Younger people, she said, feel less threatened revealing their identity than older people who have endured discrimination and harassment. She said she knows elderly gay men who have not come out to their own children.

"All of these surveys underreport when people don't feel safe," Perlich said.

Frogley agreed.

"I think there's a definite generation gap in terms of self-identification, he said.

Email: romboy@deseretnews.comTwitter: dennisromboy