"Thank God for the criminals in this world."

That's the sentiment of a grateful mom after a group of work-release inmates helped a Florida couple who'd accidentally locked their baby inside an SUV.

The baby’s mother, Shadow Lantry, posted a video on her Facebook page showing the heroic act.

The incident began after the baby was accidentally locked inside the car at the West Pasco Judicial Center in New Port Richey, Fla. The parents could not afford a locksmith, and the father intended to break a window, Pasco County Sheriff’s Office spokesman Kevin Doll told WFLA-TV.

FLORIDA MAN CARRYING HUGE RATTLESNAKE STOPPED BY POLICE AFTER SCARED LOCALS ISSUE COMPLAINTS

A few moments later, a crew of black-and-white clad inmates working nearby offered to help the couple. They were able to pry open the front door just enough for one inmate to use a coat hanger to push a button that unlocked the blue SUV.

Lantry said her 1-year-old child was “just sitting there happy” during the ordeal. The temperature outside was about 56 degrees Fahrenheit.

2 DOGS SAVE FOSTER KIDS WANDERING ALONG FLORIDA'S I-10; ONE GIRL SAID SHE WAS CHASING A RAINBOW

Sheriff Chris Nocco of the Pasco County Sheriff’s Office told WZVN-TV that the band of work-release inmates “want to do the right thing in life.”

The Associated Press contributed to this report.