An Alabama town slapped the invisible hand of the free market with an ordinance aimed at Target — which has welcomed transgender customers to use whichever restroom they wish.

Elected officials in Oxford passed a measure Tuesday banning anyone from using a public restroom that does not align with their birth gender, reported The Anniston Star.

Steven Waits, president of the City Council, said the ordinance was a direct response to Target’s policy — which the retailer outlined in response to recent bills passed by state legislatures restricting restroom access for transgender people.

ADVERTISEMENT

“We welcome transgender team members and guests to use the restroom or fitting room facility that corresponds with their gender identity,” the company posted last week on its website.

Oxford passed the anti-LGBT measure “not out of concerns for the 0.3 percent of the population who identify as transgender,” Waits said, but “to protect our women and children.”

Waits said he had personally received an “overwhelming” number of complaints from residents about the policy, which would have been in effect at the town’s single Target store.

Alleged violations of the bathroom ordinance must be reported by a witness or a police officer to be prosecuted, and violators could be fined $500 or sentenced to six months in jail.

However, the ordinance contains a couple of exceptions.

ADVERTISEMENT

Adults may accompany children under 12 into the restroom, and janitors, emergency medical workers and assistants to the disabled are allowed to enter any restroom.