A Kansas judge Thursday gave a mom convicted in the death of her toddler who perished in a house fire a get-out-of-jail-free card over the objection of prosecutors, authorities announced. 

Judge Timothy McCarthy handed Karlie Mae Phelps 36 months of probation and a deferred 18-year prison sentence after she pleaded guilty to involuntary manslaughter and child endangerment. 

If she stays out of trouble, she will serve no time in prison, but if she violates her probation, she could be on the hook for the full 18 years, according to a press release from District Attorney Steve Howe of the Tenth Judicial District in Johnson County.

Prosecutors argued that Phelps, 28, deserved to be locked up for leaving 17-month-old Nicholas Ecker Jr. at her home Feb. 13, so she could hang out at a friend's house, according to Law&Crime. 

MARIST COLLEGE PARENT MURDER: SUSPECT IN HOTEL SHOOTING LINKED TO ANOTHER HIGH-PROFILE KILLING

Booking photos of Karlie Mae Phelps and Nickolas Ecker, who is weeping

Karlie Mae Phelps and Nikcolas Ecker were charged in connection to their 17-month-olds death after the toddler perished in a house fire in Kansas. (Johnson County Sheriff's Office)

Her ex-boyfriend and the baby's father, Nicholas Adam Ecker, 28, allegedly lit the house on fire in a jealous rage at about 12:30 a.m., not realizing the child was inside.

Investigators found a heated text exchange between Phelps and Ecker before the tragedy. She told him at 10:21 p.m. that she and the baby were not home. 

KANSAS COACH FACING FELONY CHARGES HAD SEX WITH 17-YEAR-OLD STUDENT AT SCHOOL MULTIPLE TIMES

Ecker suspected that Phelps was with another man and showed up to her house in Shawnee, southwest of Kansas City, looking for her. 

He texted Phelps a photo of a Valentine's Day balloon he had given her that appeared to have been taken inside the house 20 minutes before it went up in flames, a police affidavit says. 

Ecker soon had a bad premonition. "Where is jr. Please tell me you have jr. Something is wrong," he texted Phelps at 12:58 a.m., according to court records, cited by Law&Crime. 

The suburban home in Shawnee, Kansas, where a toddler died in a house fire

The home in Shawnee, Kansas, where 17-month old Nicholas Ecker Jr. perished in a house fire lit by his father. (Google maps)

At 1:07 a.m., Phelps responded, "Go get junior NOW. HES INSIDE YOU DIMB [sic] A--. I CANNOT BELIEVE YOU STARTED THAT FIRE. YOU KILLED OUR BABY!!!"

CLICK HERE TO GET THE FOX NEWS APP

Ecker, who has pleaded not guilty, faces one count each of first-degree murder, aggravated arson with risk of bodily harm, and possession of a firearm by a felon. His case is awaiting trial.