Harry Wareham, who is 43 years old, and a 16-year veteran of the Framingham Police Department with the rank of lieutenant is facing the prospect of losing his gun license because of a conviction as a juvenile when he was 15 years old.

Things could have gone much differently for Harry Wareham.

When he was 15, Wareham admitted “I was very dumb and I made a mistake.”

Wareham committed a crime and was found to be delinquent by a juvenile court judge.

But, instead of growing up to join a roster of repeat criminal offenders, Wareham changed his life around.

Wareham, who is now 43 years old, is a 16-year veteran of the Framingham Police Department with the rank of lieutenant.

“I’m not proud of the mistake I made,” said Wareham last week, “but I think it made me a better and more understanding police officer.”

Wareham, who wouldn’t detail the charges he faced at 15, now finds his juvenile record has been unsealed, coming back to haunt him 28 years later.

Recently, his license to carry a firearm when he is off duty was denied by the state firearms board because of what it read in that previously sealed record.

A change in the Criminal Offender Record Information, or CORI law, that goes into effect in May is opening juvenile crime records — even those that were sealed by the judge — to the firearms licensing board and other agencies.

Previously, those records were not revealed.

The law’s purpose is to limit how much a job applicant’s criminal history is available to employers.

“At the end of the day, this is something that shouldn’t have come up,” said Wareham’s lawyer, Michael Brennan.

“I feel like I made a mistake and I did my part, and now this is coming up all of a sudden,” said Wareham.

The lack of his firearms permit has not affected his job. Chief Steven Carl is allowing Wareham to carry a firearm “on the badge,” which means he can have a gun while on duty.

Carl said he has never allowed an officer to carry a gun “on the badge before,” but he said this is a special circumstance.

“He was given, more or a less, a second chance, and he took advantage of a judge’s wisdom who sealed the record,” said Carl. “Twenty-eight years later, the system has failed him. To take Harry off the road is a loss to this department and this community.”

Wareham’s early life wasn’t easy. He said he lived in an orphanage from the age of 2 until he was 10, when he was moved into the foster care system.

“I had trouble adjusting outside of the orphanage and started hanging out with the wrong crowd,” he said.

After getting in trouble, he attended the former Don Bosco Technical High School. There, a “big kid” put him in a headlock and he “told me to go out for football and track.”

There, Wareham excelled, particularly in track, where he set school records.

“Sports were a very good outlet for me and it helped set me on the right path,” Wareham said.

He started working with youngsters, and that led him to major in criminal justice at Northeastern University. There, he earned a bachelor of science degree. When he graduated in 1993, he was presented with the outstanding co-op student award.

After graduating, Wareham worked with the Boston University Police, then moved on to the Duxbury Police Department.

“I enjoyed working in Duxbury, but I wanted to work in a more diverse community,” said Wareham. “I’ve tried to go out of my way to work with the community and youth.”

Wareham said he works with at-risk youth through department programs. He is also heavily involved in the Framingham department’s Police Athletic League.

Wareham said his experiences help him do his job.

“I think I have a certain level of compassion,” said Wareham. “I see someone come in here and I think, ‘But for the grace of God, that could have been me.’ It definitely shapes who I am. I have two little kids, and I always say they’ll have a better childhood than I had.”

Because of the change in the CORI law, other police officers may experience the same problem as Wareham, his lawyer, Brennan said.

“This was an unintended consequence of the law,” said Brennan. “I don’t think this was a situation that was intended. There’s an awful lot of police officers in a lot of communities that will be affected by this — model police officers.”

Carl said he doesn’t know if other officers in his department will have the same problem as Wareham when they have to renew their licenses.

The chief said Wareham has been an “exceptional” police officer over the term of his career. In 2006, Wareham became the first African-American police lieutenant in Framingham. He was also the department’s first black sergeant.

“When he became a sergeant, I told him becoming a sergeant was the easiest part,” said Carl. “He had to become a mentor for all of the minority officers because he was the first.”

A juvenile record should not come back to haunt someone 28 years later, particularly after living a productive life, said defense lawyer Stephen Weymouth.

Weymouth, who works often in juvenile courts, said the point of juvenile courts is to try to rehabilitate a juvenile, not send them on a downward spiral that affects their whole life.

“This guy is the perfect example of what the juvenile court is all about,” said Weymouth. “Some kids do bad choices and it shouldn’t be held against them for 30 years. It’s clear he was a kid who did something when he was 15 years old and is totally rehabilitated.”

Brennan said he will work to find a way to get Wareham his gun permit, possibly seeking the delinquent finding to be overturned, or through other methods.

Until then, Wareham will remain on the job at the Framingham Police.

“I keep telling (myself) adversity doesn’t build character, it displays it,” said Wareham. “I’m going to hold my head high and keep moving forward.”

(Norman Miller can be reached at 508-626-3823 or nmiller@wickedlocal.com. For up-to-date crime news, follow Norman Miller on Twitter @norman_millerMW.)