A man was shot in the stomach and another is in custody after a failed attempt to rob three detectives Sunday evening, officials said. The detectives were investigating an earlier robbery when one of the suspects approached the trio with what appeared to be an automatic weapon at Bedford and Monroe Street, in Brooklyn, around 6:40 p.m., reported PIX 11. Two of the detectives were in plain clothes, while the third wore a NYPD reflective vest.

The suspects were allegedly running a scam in which they would post fake rentals on Craigslist and would then rob anyone who had come to view the nonexistent apartments.

"The initial robbery did have a Craigslist element to it," Chief Patrick Conry, NYPD Chief of Brooklyn Detectives, said, according to CBS New York. "Very early on in the investigation, we don't know if the males that were apprehended here are connected with the initial robbery complaint." 

The weapon used in the robbery was later determined to be a BB gun.

One of the suspects, 20, was taken to Kings County Hospital in stable condition, while the detective who fired the shot was taken to Methodist Hospital due to ringing in his ears, reported The New York Times. The second suspect, 16, was arrested and taken into custody.

The last suspect, described by police as between 16 and 18 years old wearing a gray hoodie and jeans, managed to escape and is still on the loose.