The young woman who left her baby outside in a garbage bag in Elmira has been sentenced to 9 years in prison.

Harriette Hoyt had undergone a mental health evaluation, while facing charges of second-degree attempted murder, reckless endangerment and abandonment of a child.

But back in December, she settled the case against her, pleading guilty to just the attempted murder charge.

Hoyt, who was 17 at the time, was arrested back in August after her 8-month-old was found in a garbage bag that had been left outside for 3 days.

The baby was found in the bushes on Walnut Street and miraculously survived.

Friday, the judge said life imprisonment would have been a just sentence.

Hoyt will also serve five years’ probation.

Hoyt was also ordered to get counseling. And an order of protection was filed for her child.