A Chinese newborn who was trapped in a sewer pipe moments after his birth has been released from hospital into the care of his grandparents.

Local officials and media reports said Thursday that authorities have concluded it was an accident, meaning his unwed mother is unlikely to be criminally charged.

The baby's stunning, two-hour rescue from a pipe underneath a squat toilet in Zhejiang province's Pujiang county captivated the world, prompting both horror and an outpouring of charity on behalf of the boy, who was released from a hospital late Wednesday.

The boy's maternal grandparents took him home and the mother remains under medical care, the state-run Jinhua Evening News reported, in an account confirmed by a local police official who declined to give his name when contacted by telephone. Earlier reports had said incorrectly that the 22-year-old mother herself took the baby out of the hospital.

The mother had initially raised the alarm about the baby when he got stuck Saturday in a pipe just below a squat toilet in a public restroom of a residential building, but she had cleaned the room of signs of a fresh birth and did not initially come forward as the mother, officials have been quoted as saying.

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

She admitted she was the mother two days later when confronted by police who had found baby toys and blood-stained tissues in her apartment, the reports said.

Police later concluded that the incident was an accident and that the woman did not initially come forward because she was frightened, but that she later started telling the truth, the Jinhua Evening News and a Pujiang county propaganda official said. The police initially treated the case as a possible attempted homicide, but now are unlikely to file criminal charges, the newspaper and official said.

Police tracked down a man believed to be the baby's father, who has requested a paternity test and — if the baby is his — is willing to help support the child, said the Pujiang official, who declined to give his name as is customary among Chinese officials.

Officials have not publicly released the names of anyone connected with the case, which has raised discussion over China's lack of proper education about sex, birthing and contraception in many schools. Unwanted pregnancies have been on the rise because of an increasingly lax attitude toward pre-marital sex.

Duan Wanjin, a criminal lawyer based in Xi'an, said local police erred in not prosecuting the mother. He said she could be charged with attempted homicide for not immediately calling for help after the newborn became stuck.

"The local police may have considered the woman was still young and did not have any malice, and have come to the decision from the human perspective, but it sends a terrible signal to the public," Duan said.

Sociologist Li Yinhe said the only mistake by the woman was not to immediately admit the baby was hers. "I don't think that's a big deal. After all, the child is safe, and it has a happy ending," Li said. "The Chinese people still lean heavily on the human considerations. Let it be bygones if there's no serious crime."

The woman told police she got pregnant after a brief affair with the man, hid her pregnancy from family and neighbors, and secretly delivered the child Saturday in a rental building's restroom. She said the infant accidentally slipped into the squat toilet and — after cleaning up the scene — she raised the alarm.

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 (about 3 inches) in diameter.

The baby, who weighed 2.8 kilograms (6 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.