A woman accused of trying to sell her baby at a Hazel Dell Taco Bell pleaded guilty Thursday to reckless endangerment in an agreement with prosecutors that allows her to be released from jail this week.

Heidi Knowles, 36, was charged with attempted child selling, a gross misdemeanor, but agreed to plead guilty to reckless endangerment, also a gross misdemeanor. Clark County District Court Judge Sonya Langsdorf sentenced her to 77 days in jail.

Since Knowles has already been in jail 77 days, she received credit for time served and will be released from the Clark County Jail soon, said Deputy Prosecutor Jeff McCarty.

An additional 287 days of jail are hanging over her head if she does not comply with conditions of probation, including undergoing mental health and substance abuse evaluations, McCarty said. Knowles will also be on probation for two years.

Prosecutors had alleged that Knowles approached a woman at the restaurant, handed over her 3-day-old son and offered to sell him for between $500 and $5,000, according to court documents. The woman notified police.