A Redwood City woman will not serve time in prison for attempting to drown her baby after giving birth in a McDonald’s bathroom in 2017, prosecutors said.

After sentencing Friday, Sarah Lockner, 27, received four years supervised probation and one year in county jail with credit for time served, since she was in custody during her court proceedings, the San Mateo County District Attorney’s Office said.

Lockner was also ordered to complete parenting classes, undergo counseling and to take all prescribed medications, prosecutors said.

Lockner was arrested Sept. 4, 2017, when she was a cashier at the McDonald’s at 185 Chestnut St. in Redwood City working the shift from 5 p.m. to 12:30 p.m. During her shift, she went to the bathroom multiple times complaining of stomach pain. When a co-worker went in to check on her, she saw blood on the floor. Lockner told her co-worker it was just a heavy period, but a second co-worker who went into check on her looked over the stall and saw a newborn baby face down in the toilet bowl with Lockner’s hand on the baby’s back, prosecutors said.

“As the co-worker stepped down, she heard the toilet flush,” said prosecutors, indicating she intended to flush the baby down the toilet.

While Lockner told her co-worker not to call police, the police were called. Officers found the baby with no pulse but breathing. The baby was rushed to the hospital and, after a medically-induced coma, is surviving on his own although his neurological prognosis is not known, prosecutors said.

Lockner had claimed at the time that she didn’t know she was pregnant, prosecutors said.