A 5-month-old baby is recovering after being buried alive in the Montana mountains thanks to a sheriff’s deputy who heard a faint cry in the woods.

Missoula County sheriff’s deputy Ross Jessop says he was just about to give up hope while scouring a wooded area Sunday when he heard a faint cry coming from the brush.

The officers found the infant facedown under a pile of sticks and debris, clothed only in a wet and soiled onesie, a statement from the sheriff’s office said.

The sheriff’s office said it believes the baby had been there for at least nine hours.

The man who was supposed to be caring for the baby, Francis Carlton Crowley, was arrested on a charge of felony assault of a minor under 36 months and felony criminal endangerment.

Join our Newsletter for the latest news right to your inbox