In the latest setback for Boston’s beleaguered U.S. attorney, red-faced feds admit they may have arrested the wrong man during a massive gang and drug takedown two weeks ago because he looked like someone they wanted, after they were forced to tell a judge there was “sufficient doubt” that he was the suspect.

O’Neil Taylor, 30, of Norwood, who was arrested Jan. 17 and freed the next day, “looks very much like” an associate of the Hendry Street gang in Dorchester who cooks crack and goes by the street name of ‘Chew,’ prosecutors wrote in court papers. But they now say they’re not sure Taylor is “Chew.”

“Although Mr. Taylor or his vehicle was regularly in the Hendry Street area and he may in fact be the person involved in the drug conspiracy,” prosecutors wrote, “there is sufficient doubt right now that the government believes it is in the interest of justice to release Mr. O’Neil (sic) pending further investigation regarding the identity of ‘Chew.’ ”

Federal Magistrate Robert B. Collings granted the motion to release him while the feds sort out the matter.

However, the drug conspiracy charges against Taylor have not yet been dropped.

Taylor’s attorney declined to comment.

Prosecutors are expected to go before a judge today to detail their progress in determining whether they can say Taylor is “Chew” or not.

A spokeswoman for U.S. Attorney Carmen Ortiz declined to say how worried authorities are that they may have arrested an innocent man.

“We think we addressed that concern in the motion. There will be further detail in the hearing,” office spokeswoman Christina DiIorio-Sterling said.

Ortiz has been criticized for her heavy prosecution of Internet activist Aaron Swartz, who committed suicide while facing up to 35 years and $1 million in fines for hacking academic documents. And last week, a judge tossed her effort to seize a family-owned motel in Tewksbury because people had been arrested there on drug charges.

Taylor, one of 30 people arrested in the FBI-led bust, “protested that he was not the person named,” from the outset, prosecutors wrote in a motion requesting his release. “Further investigation has indicated that there is a person in the neighborhood and who is known to associate with the defendants who looks very much like Mr. Taylor (same physical build) and who allegedly goes by the name of ‘CHEW.’”