People visiting New York City-owned buildings will be able to use whatever bathroom matches their gender identity, Mayor Bill de Blasio announced today—a move that comes as several other cities have sought to stop transgender people from using bathrooms of their choosing.

“I think New York City has an obligation to lead. I think we have an obligation show that everyone should be embraced and everyone should be accepted,” Mr. de Blasio said today at a city recreation center in Chelsea. “Change comes from the grassroots. Change comes from the ground, and if people who believe in human rights don’t stand up for them, it lets those negative voices dominate.”

Mr. de Blasio signed an executive order today declaring that all city-owned buildings—schools, city offices, gyms and recreation centers like the one he visited today, some museums and public parks—that have single-sex facilities allow people to us the bathroom or locker room of the gender with which they identify. People will not be asked to show identification or otherwise prove their gender, the city said, and employees will receive training to assist them in meeting the requirements. The city’s public hospitals and public housing buildings, which are not technically covered by the order because they are run as independent authorities, have also agreed to implement the rules.

“Today, the executive order will make loud and clear that New York City is a city for us all: cisgender, transgender, non-binary,” Carmelyn Malalis, chair and commissioner of the New York City Human Rights Commission, said.

The executive order does not apply to private business. But New York City has included gender identity in its human rights law since 2002, and Ms. Malalis noted that it already “could be considered a violation of the city human rights law” to deny someone access to the restroom matching their gender identity.

But the issue of bathroom access for transgender New Yorkers continue to be a complicated one. Sean Coleman, who runs Destination Tomorrow, a grassroots agency for LGBTQ people in the South Bronx, said he once avoided going outside for more than four hours at a time, out of fear that he might not be able to use a public restroom.

And Bianey Garcia, a transgender woman and organizer with Make the Road New York, said she was once prohibited from using the women’s restroom at a restaurant by its owner.

“On that day, I felt humiliated,” Ms. Garcia said, adding that today she instead feels empowered.

Several other localities have sought to do the opposite of New York’s executive order—seeking to bar transgender people form using a bathroom for a gender different than the one listed on their government IDs or that they were assigned at birth, arguing it is necessary to protect women from men seeking to inappropriately use the same restroom.

Mr. de Blasio referred to that push as a “negative current” across the nation. “Somehow, hate is making a comeback,” he said.

Allowing people to use the restroom for the gender they live as each day is a matter of dignity, Mr. de Blasio said—and he harkened back to Senator Ted Cruz’s knock on “New York values” in touting the city’s history of inclusivity.

“We have very clear New York values,” Mr. de Blasio said. “And we’re going to stand up for them.”