ROCKLAND, Maine — A Rockland woman will serve 14 days in jail for leaving her 2-year-old autistic son home alone at night so she could visit a friend and get some chocolate.

Destiny L. Barrett, 23, was sentenced Friday by Justice Daniel Billings in Knox County Unified Court to 180 days in jail with all but 14 days suspended for endangering the welfare of a child. Barrett also will be placed on probation for a year.

Justice Billings, however, agreed the young mother had made great strides to turn her life around since the incident. The judge said a jail sentence was necessary, however, because of the seriousness of the incident and as a deterrent to others.

The incident occurred in August 2014, when Rockland police officers went to Barrett’s apartment shortly after 11 p.m. and arrested a man wanted on an unrelated probation violation. Within a half-hour of leaving the residence, police received a report from neighbors that the woman left the home without the child.

Officers responded and found the child, who was a few days shy of his third birthday, locked in a room and crying. Officers entered the home and waited a while for Barrett, who did not return. The child then was given to relatives.

Barrett was located about four hours later leaving a residence in a nearby neighborhood. Barrett told officers she was so upset about police arresting her friend earlier in the evening that she needed to visit friends and eat some chocolate. Police arrested Barrett.

Assistant District Attorney Jeffrey Baroody said a 14-day sentence was appropriate because of the seriousness of the case.

Defense attorney Marina Sideris said Barrett has worked hard to turn her life around since the incident. Barrett had undergone treatment for substance abuse and had gotten a job, the defense attorney said.

Billings said that far too often parents do what Barrett did, and a jail sentence was needed to send a message to others.