JUCHITÁN DE ZARAGOZA, Mexico — To the people of this town in southern Oaxaca State, the existence of a third gender is as much a part of life as the ancient Zapotec language they speak and the huge, spiny iguanas that laze in the trees.

Here, the muxes — people born with male bodies but who identify as neither male nor female — are part of the social fabric, admired for their embroidery, hairstyling, handicrafts and cooking.

They even have a grand ball every autumn, and their queen is crowned by the mayor.

But now this town of fishermen, farmers and extravagant fiestas about 30 miles from the Pacific Ocean faces a challenge to its expansive notion of gender: the transgender community and its bathroom rights.

On a recent sweltering night, three muxes (pronounced MOO-shays) in brightly embroidered dresses waited outside a women’s portable toilet at one of Juchitán’s annual outdoor fiestas. Men whistled at them and pointed to the dark corner that served as their restroom.