BOSTON (AP) — The highest court in Massachusetts has overturned the child rape and molestation convictions of a Burlington man because the jury was allowed to hear about a prior case in which he was cleared.

The Supreme Judicial Court overturned the 2010 conviction of 51-year-old Herbert Dorazio on Wednesday. The court wrote the decision to introduce past accusations at trial forced Dorazio to defend himself against charges he had been cleared of, tainting the jury.

Dorazio was charged with preying on two girls from 1996 to 1998 starting when they were 6. Prosecutors say he raped one girl and attempted to rape the other.

The Middlesex district attorney's office is reviewing before deciding whether to retry Dorazio.