City Room has heard of women being thrown out of men’s bathrooms, men who identify as women being thrown out of women’s bathrooms and, of course, men getting into trouble in men’s rooms. But we had not heard of a woman being thrown out of a women’s room — by a worker who didn’t believe she was really a woman — until now.

The woman, Khadijah Farmer, a 28-year-old who lives in Hell’s Kitchen, says she was at the Caliente Cab restaurant in the West Village after the Gay Pride Parade on June 24, when she left the table to go to the women’s room. While she was in there, the male bouncer burst into the bathroom.

“He began pounding on the stall door saying someone had complained that there was a man inside the women’s bathroom, that I had to leave the bathroom and the restaurant,” Ms. Farmer said. “Inside the stall door, I could see him. That horrified me, and it made me feel extremely uncomfortable. I said to him, ‘I’m a female, and I’m supposed to be in here.’ After I came out of the bathroom stall, I attempted to show him my ID to show him that I was in the right place, and he just refused to look at my identification. His exact words were, ‘Your ID is neither here nor there,’ which means that my ID didn’t matter to him.”

Ms. Farmer, who is lesbian, describes herself as “not the most feminine,” but she has been a woman her entire life. Her New York State non-driver photo identification card clearly lists her sex as female.

She said the bouncer followed her up the stairs and back to the table, asked her party to pay for the appetizers they had already eaten, and then made them leave the restaurant.

Telephone messages left today at the Caliente Cab restaurant were not returned.

Today, on Ms. Farmer’s behalf, the Transgender Legal Defense and Education Fund filed a lawsuit in State Supreme Court in Manhattan against Caliente Cab, asserting that she was the victim of gender discrimination.

While Ms. Farmer herself is not transgender, the organization sees the case as strategically important and potentially precedent-setting, said Michael D. Silverman, the executive director and general counsel of the Transgender Legal Defense and Education Fund.

The suit is being filed [pdf] under both city and state law. The city law, whose gender protections are generally considered more expansive, is intended to protect residents whose gender expression is different from what is traditionally associated with the legal sex assigned to a person at birth.

While state law does not include such a protection, the defense fund argues that state law should be interpreted as protecting New Yorkers against sexual stereotyping, in which individuals are expected to conform to societal expectations of gender-appropriate behavior. The fact that the bouncer refused to look at Ms. Farmer’s identification card before ejecting her demonstrated that he was judging her simply by how she looked, Mr. Silverman said.

Sexual stereotyping, he said, was established as a legal concept under a 1989 United States Supreme Court case, Price Waterhouse v. Hopkins, in which a woman who failed to make partner, in part because she was considered too “macho,” sued her firm for discrimination.

In a 6 to 3 ruling, the court found that evidence that a woman was judged by her male supervisors on the basis of stereotyped notions of appropriate female appearance and behavior could be used to establish the existence of illegal discrimination. While the Supreme Court ruling was used to expand the scope of discrimination lawsuits in the workplace, the legal idea of sexual stereotyping was largely dormant, Mr. Silverman said, until 2004, when the United States Court of Appeals for the Sixth Circuit ruled that transsexuals were protected.

“We’re asking the court to say that sex stereotyping by public accommodation is just as harmful when practiced by a public accommodation like a restaurant as it is when it is practiced by an employer,” Mr. Silverman said. “If Khadijah were wearing pearls and white gloves, would the bounder have treated her like that?”

Ms. Farmer says being mistaken for a man happens to her on a daily basis — especially in bathrooms or locker rooms, where she often gets funny looks. “I have a script that is almost routine,” she said. “I say. ‘I am a woman, and I’m supposed to be here.’ It’s very simple. It doesn’t come off as aggressive or violent or angry.”

That usually changes the tenor of the conversation almost immediately, she said. “Usually they are embarrassed. The common response is that they are extremely apologetic that they make the mistake.”

Before the June episode, she had never had to pull out her identification card to prove her gender, she said.

In recent years, the public bathroom has become a contentious forum for gender identity. The defense fund reached a settlement in 2005 with a security company that allows people to use the restrooms of the gender with which they identify..

Advocacy groups, like People in Search of Safe and Accessible Restrooms (yes, they use the acronym), have been advocating for gender-neutral bathrooms.

Are such bathrooms catching on? In 2005, The Times noted, the proliferation of unisex bathrooms in high-end restaurants like the Modern and Per Se. It first appeared that the unisex stalls — like electronic-eye sensors, stone communal sinks and waterfall urinals — were an attempt by restaurants to one-up each other on the bathroom frontier. But perhaps these high-end restaurants — and even colleges — are in fact at the cutting edge of gender accommodation.