(CNN) A 15-year-old girl has been imprisoned for six months for having an abortion after her brother repeatedly raped her, according to an Indonesian court official.

The girl was given the custodial sentence last week, according to Listyo Arif Budiman, one of the judges in the case and a spokesman for the Muara Bulian District Court on the Indonesian island of Sumatra.

The victim's 17-year-old brother, who raped her eight times in the last year, was given a two year sentence for sexual assault of a minor, Budiman said. The prosecution had originally petitioned for a one year sentence for the girl, he added, who had the abortion six months after becoming pregnant.

The siblings, who were both represented by government lawyers, will see out their sentences in a juvenile rehabilitation institute, the spokesman said. They will receive job training to help them integrate back into society, Budiman added.

According to Budiman, neighbors discovered the headless fetus and immediately reported the discovery to the police, who began an investigation. The girl admitted that the fetus was hers after the investigation began.

Read More