MAYVILLE, N.Y. -- Judge David Foley declared a mistrial Tuesday in the Justin Haffa case, just three weeks after the proceedings began.

Haffa is accused of robbing, assaulting and attempting to kill Chautauqua County Sheriff's Deputy Sara Cunningham along Route 60 near Cassadaga around 4 a.m. September 11th of last year.

"The court did what it had to do, based on what was in front of it. It's an unfortunate outcome, it puts us back to square one," said Patrick Swanson, Chautauqua County district attorney.

"I am very happy with the judge's decision, and I think that was the right decision, and the only decision," said Ned Barone, Chautauqua County public defender.

The decision came after Barone said he recently discovered he did not receive a piece of DNA evidence from prosecutors prior to trial or before the state rested its case. Barone had asked Judge Foley to dismiss the charges all together, since the state got the document in April.

"Of course it's always difficult getting into a trial in the third week and you've put all this work and effort into it. And then to have it to end so abruptly," Barone said.

Barone argued Swanson violated trial procedures and withheld evidence. Swanson admitted the error, but says after months of preparation on the case, it wasn't intentional and has since provided a copy of the report.

"We're frustrated with ourselves. I saw it; I knew it needed to be turned over. Made efforts to have that done and for some reason or another it didn't get turned over," said Swanson.

Barone says he can take the evidence and have an expert look it over to determine its importance.

"In order to give the defense due process and to provide the client, or the defendant with his sixth amendment right to a fair trial," said Barone.

And while a plea deal could still be an option, Barone says Haffa got a lesson in how the system works.

"He was frustrated because we've come as far as we have and he thought that he would have some resolution in the next day or two," said Barone.

The jury has been dismissed and the case is due back in court late next week.