Mary Bowerman

USA TODAY Network

A man accused of attacking two women with feces in New York City earlier this week has been taken into police custody, according to police.

The 42-year-old man was found at a homeless shelter in Brooklyn, according to the New York City Police Department.

On Monday, a 27-year-old woman was walking down the street in the Upper East Side when the unidentified man grabbed her from behind and shoved a bag of feces down her pants, according to a NYPD statement.

The woman was crying and inconsolable following the incident, according to Felix Martinez, a garage attendant who was working nearby when the incident happened, WABC-TV reported.

"She was terrified, she was shaking," Martinez told WABC-TV. "She couldn't talk, and tell me 'please help me, somebody attacked me.'"

The news station captured surveillance footage of the incident and posted it on Twitter earlier this week.

A similar incident involving another woman happened earlier in the day, according to police.

Charges are pending.

Follow @MaryBowerman on Twitter.