Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A group of inmates in New Port Richey, Florida, helped rescue a 1-year-old baby accidentally locked in a car. Shadow Lantry, the mother of the girl, documented the entire rescue in a now-viral cellphone video.

Deputies received a report of an infant who was accidentally locked inside a sport utility vehicle at the West Pasco Judicial Center on Thursday, according to Pasco County Sheriff's Office spokesman Kevin Doll.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

When deputies arrived, they learned that the father of the baby, who appeared comfortable in her car seat, had accidentally locked his keys in the car. The infant's parents told authorities they could not afford a locksmith, Doll told NBC News.

After several minutes, the father told deputies he was going to break the driver's side window.

But a Pasco Sheriff’s Office Inmate supervisor and a crew of low-risk, non-violent offenders known as trusties were repairing medians in the parking lot outside the judicial center a few feet away and offered to help.

In the video, deputies can be heard telling the dad to "pop his head in the window," so the infant would not be scared by "strange faces."

The infant's father and some of the trustees pried the front door open just enough for another trustee to use a coat hanger to push the electronic door lock open, the video shows. It took about two minutes to unlock the car. Once they did, the group cheered.

"Thank God," the girl's mother said once the car was unlocked.

The parents checked on their daughter and thanked everyone for their help.