A convicted killer has walked out of a New York state penitentiary a free man.

The 2018 murder conviction of Terrence Lewis has been vacated due to an oversight by the Monroe County Sheriff’s Office.

“We understand we should have known the law...we didn’t. We made a mistake," said Monroe County Undersheriff Korey Brown.

The Monroe County Sheriff’s Office transports inmates regularly. Of the hundreds of transfers during the current sheriff’s tenure, one involved a law the Sheriff’s Office had not been exposed to or used before.

It’s the anti-shuttling provision of the Interstate Agreement on Detainers Law.

“So the law makes it so you have to have a trial within 180 days, and it makes it when you go somewhere you can’t be shipped across state lines while you’re awaiting the finality of the case, for the case to be disposed of," said Brown.

The case involves Terrence Lewis, who was sentenced in 2018 to 22 years to life in prison for the shooting death Johnny Washington in Rochester.

While Lewis was awaiting trial in Monroe County, he was returned to a federal prison in Pennsylvania where he was serving time on other unrelated charges.

That transfer violated the law.

Monroe County Undersheriff Brown and Monroe County Sheriff Todd Baxter say they didn’t know about it.

“What this agreement on detainer, the interstate agreement on detainers, says you can’t do that and we did not know that,” said Brown. “It says once you come some place for a trial you have to stay there until a case is done. At that time it was not known, that section of the law, that section on detainers was not known to us.”

“What occurred was, if you will, a lack of knowledge of the law and we returned, like we normally do as practice, him to his home prison while he awaited his murder trial here in Rochester. It’s really unfortunately that simple,” said Baxter. “We did not see that law. We should have. The judge is very clear on that. We’re responsible for that. But it’s a law that’s not often used and my staff simply did not see it and we transferred him. And we transferred him for good reason. We weren’t trying to hide him or slow down his proceedings on the murder trial, but we were trying to get him returned to his home bed that’s where he lives. That’s where his services providers are [and] that’s where he gets mail; all these things are reasons why we try and put people back in their home prison as quick as possible without interfering with their trial process of course.”

Lewis was released from prison last week. The conviction has been fully vacated with prejudice, meaning he cannot be retried on the murder charge. In fact, it is expunged from his record.

The Monroe County Sheriff’s Office is retraining and reviewing all transfer procedures.

And the sheriff has already reached out to Rep. Joe Morelle in an effort to try get this law changed because he believes the consequences for a violation are too harsh. Sheriff Baxter offers his sincere apology to the family of the victim.