A teenager accused of abandoning her newborn baby in a building's dumpster in Northern California in scorching heat was cited for child abuse and will be released to her parents after she leaves the hospital, police said Wednesday.

Two people found the boy wrapped in a blanket inside a plastic bag Tuesday afternoon in Stockton, about 50 miles (80 kilometers) south of Sacramento. Officers later found his 15-year-old mother while canvassing the apartment complex, but it's unclear if she lives there, Stockton Police Department spokesman Officer Joseph Silva said.

An apartment complex resident heard cries and notified the manager, who pulled the child from the building's dumpster, Silva said.

The boy, who weighed 6 pounds and 7 ounces (2.9 kilograms) and was 20 inches (51 centimeters) long, still had his umbilical cord and was taken to a hospital, where he was doing well Wednesday, Silva said.

It's unclear how long the child was in the dumpster, when temperatures in the area reached 102 degrees (39 Celsius). The dumpster was under a tree.

The police department received several messages via social media asking how the child could be adopted, Silva said.

"We refer those calls to Child Protective Services," which is caring for the baby boy, Silva said.

Apartment managers told KTXL-TV they spotted the teen mom walking into the complex Tuesday morning and did not recognize her as one of their renters.

No one answered at the unit where she was found. No one living nearby could tell KTXL who lived there.

Detectives are still trying to determine her connection to the building, Silva said.

Silva called the resident and the building manager who found the boy heroes and said they probably prevented the newborn's death.

"If they did not spring into action so quickly, this incident could have become a tragedy," he said.

Resident Troy Cooper told the Stockton Record he was returning home from visiting a friend when he heard what sounded like a kitten and a baby crying at the same. Something told him to investigate, and it was then that he saw something moving inside the dumpster.

Cooper was unable to get into the dumpster so he called on-site manager John Pedebone.

"I tried to listen, and I saw the bag was moving," Pedebone said. "My first thought was that it was probably a dog, but when I listened carefully, I could hear the baby."

Pedebone, who has four children, said that as a father he was left feeling saddened and confused but found comfort in knowing the baby is doing well.

"Hopefully," he said, "everything will be fine."

Pedebone didn't immediately return a message from The Associated Press seeking comment.