A new policy over bathroom choice has thrust the retailer Target into the center of a nationwide debate over gender identity, civil rights and privacy.

Last week, Target announced on its website that it would allow transgender employees and customers to choose the restroom and fitting room that corresponded with their gender identities. About a month earlier, North Carolina passed a law restricting bathroom access to transgender people, a bill that set off a national debate that has even extended to the presidential campaign.

The company’s announcement — the most prominent position taken by a national retailer — was greeted by cheers from supporters of transgender rights. It has since also made Target the intense focus of conservative activists, lawmakers and consumers, who oppose the company’s stance, highlighting the potential risks when a company takes a position on a hotly debated social issue.

Some groups have used Target’s announcement as a rallying cry, arguing that Target’s policy threatens the public’s safety. An online petition started by one group, the American Family Association, calling for a boycott of Target stores, has been signed by more than 900,000 people. On Tuesday, the City Council in Oxford, Ala., passed an ordinance forbidding people to use a bathroom that does not match the gender assigned to them at birth. Target has a store in the city.