A newborn whose rescue from a sewer pipe in China captivated the world has been returned to his mother after authorities decided he became trapped because of an accident, a local official said Thursday.

The baby's stunning, two-hour rescue from a pipe underneath a squat toilet in Pujiang county prompted both horror and an outpouring of charity on behalf of the boy, who has been taken away from a hospital by the unwed mother and a man believed to be the father.

The man has requested a paternity test and — if the baby is his — is ready to discuss with the woman how to support the child, an official at the Pujiang county propaganda office in Zhejiang province in the eastern part of the country said Thursday.

It was not clear if the couple would raise the child together. Officials have not publicly released the names of either of the two adults.

The baby, shown lying on a bed at a hospital in Jinhua, China, suffered only minor injuries.The baby, shown lying on a bed at a hospital in Jinhua, China, suffered only minor injuries. (Shaanxi TV via AP Video/Associated Press)

The case has raised discussion of China's lack of proper education about sex and birthing in many schools. Unwanted pregnancies have been on the rise because of an increasingly lax attitude toward pre-marital sex.

Police concluded that the 22-year-old single woman faces no charges, deciding she did not initially step forward because she was frightened, and that she gradually had a change of heart and began to tell the truth, said the official, who did not give his name, as is customary among low-ranking Chinese bureaucrats.

The woman told police she got pregnant after a brief affair with the man, hid her pregnancy from family and neighbours, and secretly delivered the child Saturday in a rental building's restroom. She said the infant accidentally slipped into the squat toilet and raised the alarm. Yet, she did not initially claim the child was hers.

Firefighters who arrived at the rental building found the infant trapped in an L-shaped section of sewage pipe just below the squat toilet in one of the building's shared restrooms.

In video footage, officials were shown removing the pipe from a ceiling that apparently was just below the restroom and then, at the hospital, using pliers and saws to gently pull apart the pipe, which was about 10 centimetres in diameter.

The baby, who weighed six pounds, 2.8 ounces, had a low heart rate and some minor abrasions on his head and limbs, but was mostly unhurt, according to local reports. The placenta was still attached.