Prosecutors say a woman charged with leaving her weeks-old daughter on the side of a road in Maryland has pleaded guilty to reckless endangerment.

Anne Arundel County State's Attorney Wes Adams said in a news release that 27-year-old Sandra McClary entered the plea Monday in county circuit court. She was sentenced to time served and put on probation for five years. She must undergo drug and alcohol treatment and complete a parenting class.

According to charging documents, a Pasadena resident found the 6-week-old child in a carrier just before midnight July 4 on the side of the road near her house. The baby was in good condition.

Prosecutors say McClary told investigators that after an argument with her boyfriend, she drove off without her boyfriend and the baby.