A 34-year-old man was charged Sunday with attempting to rape a woman inside the Flaming Saddles Bar in midtown, police said.

Ricardo Lambert, who lives a few blocks from the Wild West-themed Hell's Kitchen gay bar, allegedly grabbed the 34-year-old woman as she was leaving the bathroom at about 10:30 p.m. on Friday night, police said.

Lambert was held on $250,000 bail at his arraignment Sunday. An attorney for Lambert could not be immediately reached for comment.

Lambert choked her until she lost consciousness and threw her onto the bathroom floor, according to the criminal complaint. He then allegedly took off her underwear.

A security guard at the bar heard the attack and pushed into the bathroom, according to police and the criminal complaint.

The guard told investigators he saw the woman on the floor of a stall with Lambert standing over her, according to court records. He tried to push his way into the stall, but Lambert allegedly held it shut.

Eventually, the guard opened the door and pulled Lambert off the woman, according to court records.

His next court appearance is scheduled for October 17.