The man accused of leaving a 5-month-old baby in a Montana forest reportedly broke down crying when he heard allegations against him in court on Tuesday — two days after a search team discovered the infant buried under a pile of sticks and debris.

From his jail cell, Francis Carlton Crowley, 32, appeared via videoconference in Missoula County Justice Court on Tuesday on charges of assault on a minor and criminal endangerment, according to the Associated Press.

As the judge and prosecutor read the allegations, Crowley doubled over and fell to the floor, the AP reported. He twice exclaimed that he loves the boy and pleaded with the judge not to take him away.

A 5-month-old infant with dirt under their fingernails after authorities say the baby survived hours being buried under sticks and debris in the woods on July 8, 2018. Missoula County Sheriff's Office via AP

Crowley did not enter a plea. His relationship to the child — and the identity of the boy's mother — were still not clear.

He told investigators he had been in a car crash and left the baby behind because the child was "very heavy," prosecutors said in an affidavit obtained by NBC News.

The baby, who was left alone for at least seven hours, was discovered in the middle of the night on Sunday, officials in Missoula have said. He was in good condition, according to the Missoula County Sheriff's Office.

"It was a miracle," Ross Jessup, a Missoula County sheriff's deputy, said at a news conference on Tuesday. "I had prepared myself mentally to find a dead baby, if at all, and seeing and hearing that baby overcame me with so much joy."

The sheriff's office said authorities were called to the Lolo Hot Springs area of Montana's Lolo National Forest at about 8 p.m. Saturday night (11 p.m. ET) on a report of a man threatening people and acting strange.

In the probable cause affidavit, prosecutors said Crowley had originally said he would take the officers to the baby's location. But he was "disoriented" and potentially under the influence of drugs, so ultimately could not help, prosecutors wrote.

And so authorities began scouring on their own, Missoula County Sheriff T.J. McDermott said at a news conference on Tuesday. McDermott said officials found clues — baby formula, a diaper bag — strewn throughout the woods as they searched.

But what ultimately took them to the right spot was a sound — the faint cry of a baby.

It was 2:30 a.m. Sunday local time and 46 degrees outside when they found the infant, the sheriff's office statement said. The boy — who was wearing only a wet, soiled onesie when authorities found him — was in protective custody on Tuesday night, officials said.

"When I heard that baby murmur, I was so happy. I was more happy than hearing my own daughters cry for the very first time," Jessup said on Tuesday.