A Buffalo, N.Y., mother whose baby boy ate crack cocaine and opiates at a party was spared jail time because a judge was impressed by her efforts to turn her life around.

Marceia Dixon, 23, pleaded guilty in August to attempted child endangerment for the incident involving her 8-month-old son.

Dixon brought the baby to a party in June where people were smoking crack. He became ill and went to the hospital after he accidentally ingested the drugs.

She was originally charged with endangering the welfare of a child and assault.

In court Tuesday, the judge sentenced the mother to one year of probation and ordered her to submit to Buffalo Drug Court scrutiny to overcome her issues with marijuana.

He said he was influenced by her "evidence of remorse," The Buffalo News reported.

Dixon was also ordered to keep a job she recently got, continue drug counseling and submit to random drug tests.

Her son is currently in his grandmother's custody. Dixon visits him every day under supervision, according to the News.

Dixon's lawyer, Ayoka Tucker, said her client has endured "a great deal of remorse" over the sick baby and has "removed herself from the situation" by relocating, the paper reported. She said Dixon is getting counseling for substance abuse.

Click here for more on this story from The Buffalo News.

The Associated Press contributed to this report.