According to reports, Hitesh Kumar Sirohi, a trader, rescued the newborn girl and fed her milk using cotton. The girl has now been admitted to a private hospital.
According to Superintendent of Police (city) Abhinandan Singh, Sirohi's wife Vaishali is a sub-inspector posted in Bareilly.
She was admitted to a private hospital last week after she complained of labour pains.
She gave birth to a seven-month premature girl, who died within a few minutes.
Sirohi had gone to bury his daughter and as the pit was being dug, at a depth of three feet, the spade hit an earthen pot, which was pulled out. There was a baby girl lying in it.
The SP said that the girl was alive and breathing heavily. She was taken to the district hospital and admitted. Her condition is stable now.
The police official said that the details of the girl's parents, who had attempted to bury her alive, were yet to be ascertained.
Chief Medical Officer (CMO) of Bareilly Vineet Shukla said that the local Bharatiya Janata Part (BJP) MLA Rajesh Misra had taken the responsibility for the girl's treatment.
Senior Superintendent of Police Shailendra Pandey said a probe was launched to ascertain who had buried the infant alive.
The trader, on the other hand, has offered to adopt the child.