BOSTON (AP) — A man whose conviction was overturned in a day care molestation case after he spent 21 years in prison asked a judge Tuesday to wipe his record clean.

Bernard Baran was convicted in 1985 of molesting five children at the Pittsfield day care center where he worked at a time when there was a national hysteria over child-care sex abuse cases.

Baran, then 19, insisted he was innocent but was convicted and sentenced to life in prison.

He was released in 2006 after a judge ruled that his trial lawyer was incompetent. Prosecutors decided not to retry him.

The state attorney general's office and the Pittsfield Police Department oppose the move to erase his record.

During a hearing Tuesday in Suffolk Superior Court, Assistant Attorney General David Hartnagel argued that under state law, criminal records can be expunged only after a defendant receives a judgment in his favor against the state in his erroneous conviction cases. Baran reached a $400,000 settlement with the state, but the state denied liability in that settlement.

"There's ultimately never been a finding here of actual innocence," Hartnagel said.

But Baran's lawyer, John Swomley, said both sides agreed to reserve the question of whether Baran's record would be expunged outside of the settlement. Swomley said the overwhelming evidence in the case showed that the children weren't molested at the day care center.

"There really were no crimes committed at all," Swomley said.

Although there were hours of videotaped interviews with the children, jurors, Baran and his lawyer didn't see all of them, including tapes in which the children said he had never harmed them. The judge who overturned his convictions and ordered a new trial cited his trial lawyer's incompetence and the videotapes.

The judge Tuesday didn't immediately rule on Baran's request.

Swomley said he was puzzled by the state's decision to agree to give Baran a monetary settlement but to oppose his request to expunge his record.

"They don't just hand out money to people they think are guilty," Swomley said after the hearing.

Baran, now 47, said he had trouble finding a job after he was released in 2006 because people were reluctant to hire him even though his convictions were overturned. He eventually found work as a landscaper through one of his supporters, he said.

He said expunging his record would help him feel more secure.

"It's been 27½ years since my original arrest and I'm still dealing with this situation," he said after the hearing.

"I don't feel like the state has ever humanely let me out of their grasp."