The highest court in Massachusetts has overturned a murder conviction in the 2005 slaying of a man in New Bedford and ordered a new trial.

The Supreme Judicial Court on Friday ruled that a lower court judge should not have allowed a secretly recorded prison confession to be admitted as evidence in the case against John Burgos.  Burgos was convicted in 2010 of the slaying of Dana Haywood on July 4, 2005 near Monte Park in New Bedford.

The justices said the state's case hinged largely on a conversation recorded by Burgos's cellmate.

But the judges ruled that police did not show adequate justification for the wiretap when they sought and received a warrant for the wire. Generally state law bans wiretaps unless there was some link to organized crime. The decision sends the case back to the lower state Superior Court for a new trial.