In the week since President Trump declared that transgender Americans would no longer be allowed in the military, some municipal officials have responded with an invitation: join our police force instead.

Several cities — including Houston; Austin, Tex.; Aurora, Colo.; and Cincinnati — have encouraged transgender people to apply to their police departments. In Austin, San Diego, Seattle and other places, transgender officers already serve openly.

“If you are dismissed from our military because of who you are, know that you are welcome in the city of Cincinnati and our police department,” Chris Seelbach, a city councilman, said at a protest last Wednesday in response to Mr. Trump’s announcement.

Mr. Trump revealed his ban in a series of three tweets from 8:55 to 9:08 a.m. on July 26. By the evening, two cities in Texas — where state lawmakers have been engaged in a high-profile debate over whether transgender people should be allowed to use the public bathrooms of their choice — had declared themselves in opposition to the ban.