Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Eleven people were released from jail in Martin County, Florida, and a deputy was fired after tests revealed that substances that were the basis of some of his narcotics arrests were not drugs.

Sheriff William Snyder said he fired Deputy Steven O’Leary on Jan. 14 for allegedly falsifying the arrests in the county, south of Port St. Lucie on Florida's east coast. O'Leary was employed by the sheriff’s office for 11 months and was still on probation.

"The inmates who were arrested by the deputy on any related drug charges were released at the sheriff’s discretion," sheriff's office spokeswoman Christine Weiss told NBC News on Wednesday. "The sheriff felt that it is better to release 100 people who are guilty than to have one innocent person remain in jail."

Some of those freed had drugs on them when they were arrested, sheriff's Lt. Michael Dougherty said Monday. But their charges were dismissed because all had been arrested by O'Leary and authorities "couldn't find anything credible with anything" he did.

"We’re trying to undo whatever harm has been done," Snyder said of the 11 released from jail. "We’re actually helping them with expungement, paying the fees, doing everything we can to make these people as whole as possible."

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"We recognize that we can’t ever completely undo everything that was done, but we will do everything we can to make amends," he said.

One of the 11 freed is Matt Crull, who spent more than a month in jail on drug trafficking charges before the alleged heroin found in his van turned out to be laundry detergent, the sheriff's office said.

Crull, 29, was sleeping in his van in a parking lot when he was approached by O’Leary on Dec. 5.

O'Leary found a powdery substance wrapped in plastic in the driver's side door of the van. Crull told him it was Tide laundry detergent. O'Leary said a field test proved it was heroin.

“I just looked at him baffled and confused because I had no idea as to where 92 grams of heroin came from inside my van,” Crull told NBC affiliate WPTV in West Palm Beach, Florida.

After 41 days behind bars, Crull was proven right.

The sheriff's office began to investigate O' Leary's arrests after it got a tip from a state attorney who noticed questionable lab results related to three drug cases O'Leary allegedly handled.

As of Wednesday afternoon, there were no charges against O'Leary, but Snyder said a charge of official misconduct is possible.

Authorities said they are in the process of reviewing all of O’Leary’s cases. It is not clear whether O'Leary is represented by an attorney at this time.

“No matter what we do, no matter how hard we try, just based on the law of possibilities, there’s always a possibility that one bad apple will slip through,” Snyder said.