Police said the family hailed from Unnao in Uttar Pradesh.
The girl and her parents, who work as migrant labourers in Chandigarh, had gone to their native place and stayed there for a month when the incident took place, Deputy Superintendent of Police, Krishan Kumar said.
The girl was raped by a distant relative, he said.
He said after the victim complained of pain in the abdomen, she was taken to a hospital here by her parents where it was found that she was six-weeks pregnant.
Hospital authorities informed the police and later a complaint was filed by the father of the minor girl.
According to the complaint, the family came to know about the pregnancy when the girl complained of pain in her abdomen on Monday.
Mr Kumar said a case was registered under the provisions of the Protection of Children from Sexual Offences (POCSO) Act and other relevant provisions of the law and further investigations were on.
A court in Chandigarh had in October last year convicted two brothers after finding them guilty of raping their 10-year-old niece, who delivered a baby in August, 2017, after the Supreme Court dismissed her abortion plea.
On July 28 last year, the Apex Court had dismissed a plea seeking its nod to terminate the 32-week pregnancy after taking note of a medical report that abortion was neither good for the girl nor for the foetus.