The Oxford, Alabama, city council unanimously approved an ordinance on Tuesday that bars trans people from using any public bathroom that doesn’t match the sex indicated on their birth certificate. Because changing one’s birth certificate is difficult in many states (including Alabama) and impossible in others, the measure effectively proscribes trans people in Oxford from using any bathroom outside of their house. Trans people who violate the ordinance may be imprisoned for up to six months.

Oxford’s new law aligns neatly with Republican presidential candidate Ted Cruz’s views on trans bathroom usage: Cruz recently asserted that trans people should only be allowed to use their home bathroom in order to protect women and children. The ordinance is also similar to “bathroom bills” in other states, such as Florida, where a bill to exclude trans people from public bathrooms sailed through committee before stalling last year. In March, North Carolina forbade trans people from using government bathrooms that align with their gender identity—including facilities at schools and universities—while the South Dakota legislature attempted to exclude all trans public school students from their preferred restroom facilities. The South Dakota legislation died on the governor’s desk; the North Carolina bill passed easily, though a lawsuit has contested its legality. (A federal appeals court recently held that federal law prohibits public schools from discriminating against trans students by forcing them into the incorrect bathrooms.)

As Oxford’s city council noted, the new ordinance is a response to Target’s announcement that it will allow transgender customers and employees to use “the restroom or fitting room facility that corresponds with their gender identity.” Target’s decision has provoked a boycott among conservatives; it also spurred Liberty Counsel president Anita Staver to declare that she will bring her “Glock .45 to the ladies room” at Target. (Staver’s Liberty Counsel defended anti-gay Kentucky clerk Kim Davis, encouraging her to violate a federal court order.)

No trans people have yet been convicted of molesting women and children in bathrooms or changing facilities. However, former Republican Speaker of the House Dennis Hastert did admit on Wednesday that he sexually abused children, including one in a locker room. Hastert joins a growing list of Republican politicians who were accused of criminal misdeeds in bathroom facilities, including John Hinson, Larry Craig, and Bob Allen. Change.org is currently circulating a petition to ban lawmakers from using bathrooms in federally owned buildings—“to protect our children.”