The baby is said to be doing well and is in the custody of child protective services.
Authorities said the baby boy was found wrapped in a plastic bag shortly before noon in Stockton, which is about 50 miles south of Sacramento.
Startled, he called his apartment manager, John Pedebone, for help.
"Instinct as a dad, I just need to try to do anything that I could to help out the baby before the ambulance gets here. So, I just make sure that he's breathing and warm", Pedebone said.
After searching through the garbage bin, SPD said officers found a newborn baby boy alive inside "and medics transported the baby to an area hospital for treatment". Police later found the 15-year-old mother near the scene and brought her to a hospital for treatment.
Cooper said he was passing by when he first heard something that sounded like a kitten, but said "it was unbelievable" when he looked and saw a baby.
Investigators located the newborn's teenage mother near the scene, police said.
Local officials are also hoping that this disturbing incident will serve as a reminder that newborns "can be safely surrendered to any firehouse or hospital emergency rooms in the City of Stockton within 72 hours of birth without fear of being prosecuted as long as the baby shows no signs of abuse or neglect".
"Today, here in our region, it is extremely hot", Silva said.
It's not clear how long the baby was in the dumpster, Stockton Police Department Public Information Officer Joseph Silva said. "We're calling those good Samaritans heroes".
The teenager will be cited for felony child abuse and endangerment and released to her parents, according to the police department. "It was just a parent helping a child", he said. Anonymous tips can also be submitted through the local Crime Stoppers by dialing 209-946-0600.