A 10-year-old girl in India, who is six months pregnant after allegedly getting raped by her uncle, has been refused permission to get an abortion.

The girl had applied to undergo the procedure at Chandigarh district court after it was confirmed she was 26 weeks pregnant.

The girl was alleged to have gotten pregnant while she was repeatedly raped by her uncle for several months, without the knowledge of her wider family.

It was only discovered she was pregnant after the girl frequently complained that she was suffering stomach pains, reported the Times of India.

Indian law does not permit the terminations of pregnancies beyond 20 weeks unless the fetus is proven to be genetically unviable or it would risk the life of the mother.

The court has denied the girl the chance of an abortion on the advice of eight doctors, who were involved in examining the child.

One of the doctors told CBS News on the condition of anonymity: "We evaluated the girl very critically and recommended a natural delivery because the fetus is viable and can survive even if delivered now.

"Abortion is not an option at this stage. The only way to terminate the pregnancy is to deliver the baby."

Geeta Chadha, a gynaecologist at Apollo Hospital, agreed it is too risky to perform an abortion because the girl is in the latter stages of her pregnancy.

She told The Quint: "It's complicated because she herself is a child. At 10 her own organs and body are not fully developed. She is physically at risk of carrying the baby to term.

"But at 26 weeks, I feel abortion is also not possible. At this stage, we consider the fetus a baby who can survive outside the womb. She'll need specialised care and monitoring. If there is any risk, do a preterm delivery at 31 -32 weeks. As a doctor, you have to weigh the risks and protect the rights of both the girl and the unborn baby."

While cases like this are rare, there have been similar examples occurring in India in the past. In 2015, a court allowed a 14-year-old rape survivor to terminate her 25-week pregnancy.

Another 10-year-old girl was between 18 and 22 weeks pregnant was also allowed the procedure in Haryana state after a medical panel ruled a delivery would not endanger her life.