Jesse Hernandez had been playing in Griffith Park when he fell 25ft into fast-moving sewage on Easter Sunday, the Los Angeles Fire Department said.
A frantic 12-hour search of the underground pipes was launched using cameras propped on flotation devices before rescuers spotted images of handprints.
Emergency workers rushed to the scene and opened a manhole cover when they heard a cry of “help”, officials said.
Jesse, who was 11ft deep in the pipe, was pulled to safety, hosed down and given immediate medical attention, the fire department said.
Authorities called his survival “miraculous” and said he had managed to find a pocket of breathable air while trapped.
Fire department spokesman Brian Humphrey said: “Any subterranean location, particularly one that involves waste, can produce toxic gases – methane, hydrogen sulfide – so breathable air is a key element.
“The odds of someone falling into such a pipe and surviving are slim. The odds were not in his favour, and many would call it miraculous.”
After his rescue, Jesse told KNBC-TV: “I was praying to God to help me and to not die.
“It was all quiet. You could just hear the water running through and you couldn’t see anything. It was dark.”
About 2,400ft of pipe had been inspected when rescuers found Jesse less than a mile from where he disappeared.
He was taken to a hospital for a full evaluation and was reunited with his family.
More from California
SUV cliff crash that killed family of eight may have been ‘intentional’
Police bodycam footage released after man shot in barbershop
Army veteran shoots dead three female hostages in California
Teen’s videos reveal glimpse of House of Horrors
Man kidnapped and killed three-week-old girl and shot her parents
‘Torture parents’ David and Louise Turpin face further abuse charges
Mr Humphrey called Jesse “a resolute young man.”
“He has tremendous inner strength,” he added. “It’s obvious he’s not a quitter.”