Activists have criticised the jailing of a 15-year-old Indonesian girl who had an abortion after being raped by her brother.

A district court in the rural Jambi province sentenced the teenager to six months in prison. Her 18-year-old brother was sentenced to two years for sexual assault of a minor.

Easmus Napitupulu, programme director of the Institute for Criminal Justice Reform, said the court did not take into account the reason for the abortion.

"The court may decide that she is guilty of having an abortion, but if we see the background that encouraged her to do so, do we need to punish her?" he asked. "Yes, she violated the law, but she should not be held accountable."

Maidina Rahmawati, head of research at the same organisation, told CNN: “It is clear that the judge involved didn't really examine this case…They don't look deeper into what things were really happening behind the case."

Zubaidah, director of the Embun Pagi Women School in Jambi, on the island of Sumatra, said the girl's sentence was unfair and violated child protection law

"It is an incest case that has to be seen more comprehensively than merely an abortion," said Zubaidah who uses one name.

Abortion is illegal in Indonesia but is allowed in cases of rape. However, it must take place within one and a half months of conception and must be performed by professionals.

The girl – who was raped eight times by her brother between September and May – had her abortion when she was six months pregnant.

Listyo Arif Budiman, court spokesman, said: "The judge panel concluded that in spite of being under-age, the defendant should have protected the foetus, should have given the foetus the right to life." He added that, because of their ages, the panel ruled that both girl and brother must undergo rehabilitation at the country's Institute for Special Education of Children.

Police arrested the siblings in June after a headless male foetus was discovered at a palm oil plantation near the province’s Pulau village. Both are understood to have accepted their sentence and will not be appealing.