A 13-year-old boy said he was praying to God for help after falling into a river of sewage in Los Angeles.

The boy was rescued after being swept away and spending more than 12 hours in the city’s toxic and maze-like underground sewer system.

Jesse Hernandez had been playing with other children on wooden planks over an access portal to the sewer system during a family outing on Sunday at a Los Angeles park.

When a plank broke, Jesse fell about 25 feet and landed in fast-moving sewage, said Brian Humphrey, a spokesman for the Los Angeles Fire Department.

The other children immediately notified adults, who called 911, initiating a frantic and exhaustive 12-hour search of labyrinthine underground pipes using cameras propped on flotation devices.

Rescuers finally found Jesse after seeing images of handprints on a sewage pipe. A sanitation crew rushed to the area and opened a manhole.

“The first thing they heard was ‘Help!’,” said Adel Hagekhalil, assistant general manager of the sanitation department.

The crew lowered down a hose to Jesse, who was about 11 feet deep in the pipe.

“He caught on to the hose and was reeled back up,” Mr Hagekhalil said.

Jesse Hernandez has been found alive!

He has reunited with his family & is being taken to a hospital for medical evaluation. Grateful to the 100+ personnel & the teams from multiple departments who worked tirelessly to find him & bring him home, safely. https://t.co/DerjhmmVRy

Rescuers gave him immediate medical attention, including hosing him down to get rid of the sewage and cleaning out his eyes and nose with sterile saline, Mr Humphrey said.

Jesse immediately asked for a mobile phone to call his family. A worker handed him a phone, and he called his mother.

The boy later told KNBC-TV that he was tired but otherwise fine.

“I was praying to God to help me and to not die,” Jesse said. “It was all quiet. You could just hear the water running through and you couldn’t see anything. It was dark.”

Video released by the city later in the day showed long dark marks on the sides of the dank sewage pipe, which was about four feet in diameter, where Jesse’s fingers would have slid.

After an accident like Jesse’s, rescuers said the likelihood of someone being found safe diminishes by the hour. Mr Hagekhalil said rescuers were thrilled at the outcome.

“They never gave up hope,” he said. “They wanted to bring Jesse back to his family.”

Amazing news...after more than 12 hours of searching, 13-year-old Jesse Hernandez has been found alive! We witnessed an incredible team effort by many public safety agencies. Join us in saying to all of them, THANK YOU! https://t.co/TbVQaIMd9G