Sixty U.S. cities earned perfect scores on a nationwide ranking of protections for LGBTQ (lesbian, gay, bisexual, transgender, queer) people, despite an array of anti-gay efforts by state governments, the Human Rights Campaign said on Monday.

The number of cities with perfect scores in 2016 was up from just 11 cities in 2012, the first year of the rating system, said the HRC, a civil rights organization in Washington, D.C.

The Empire State building is lit in rainbow colors in celebration of the annual Gay Pride Week in New York June 28, 2015. Xinhua News Agency/Getty Images

The cities with high scores have inclusive laws and policies prohibiting discrimination against LGBTQ people in employment, housing, public accommodations and access to services, it said.

The Morning Rundown Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"This year, dozens of cities across the nation showed they are willing to stand up for LGBTQ people in their communities even when state governments are not," said HRC President Chad Griffin in a statement.

This year saw developments such as passage of a law in North Carolina that nullified local ordinances that would have expanded LGBTQ protections.

North Carolina also has been the site of a battle over use of public restrooms by transgender people, mandating that multiple-use bathrooms and locker rooms be restricted according to a person's biological gender.

North Carolina allows government officials to refuse to perform same-sex marriages if they cite religious objections, and Mississippi law allows businesses with religious objections to deny services to gay couples.

The top-ranked 60 cities include Phoenix, Arizona; Orlando, Florida; Detroit and New York City.

"New York City prides itself on being an inclusive city for all, regardless of who they love or how they identify,” said Mayor Bill de Blasio in a statement.

Eight U.S. cities scored zero points, including Wasilla, Alaska; Clemson, South Carolina and Sheridan, Wyoming.

The index looked at 506 cities, including the 50 state capitals, 200 largest U.S. cities, five largest cities in each state and cities home to a state's two largest public universities.

Follow NBC OUT on Twitter, Facebook and Instagram.