GREENWICH VILLAGE — The NYPD is searching for a man they say threatened to cut a pregnant woman and her unborn baby at a Greenwich Village ATM.

But sources said police already had the man in custody 10 days earlier on separate charges, before a judge let him go against the wishes of the Manhattan District Attorney’s office.

Melvin Johnson, 49, is wanted by the NYPD for robbing a pregnant woman at knifepoint March 30 at a Bank of America ATM on Sixth Avenue.

Johnson had been arrested just a week and a half earlier, on March 19, for drinking a 24-ounce can of Four Loko in front of 374 Sixth Ave. at about 7:45 p.m., just a block away from the ATM where he is suspected of robbing the mother-to-be of $400.

When Johnson was arrested on March 19, police said they found a glass crack pipe in his left sweatshirt pocket, along with a credit card in a woman’s name. Investigators tracked down the woman and she told them Johnson did not have permission to use or have her credit card.

Johnson was arraigned on March 20 on a felony charge of criminal possession of stolen property in the fourth degree for the credit card, as well as criminal possession of a controlled substance, a misdemeanor, and consumption of alcohol in a public place, a violation.

The prosecutor at Johnson’s arraignment on March 20 asked the judge to set Johnson’s bail at $20,000, sources said. The judge refused and let Johnson go free.

Ten days later, Johnson rushed in behind the 35-year-old expectant mother at the Bank of America ATM at 390 Sixth Ave. about 10 a.m. and demanded she give him money or he would “cut you and kill your baby,” sources said.

Johnson is due back in court on June 23 for the March 19 arrest. His attorney did not immediately respond to a request for comment.