JAMBI (AFP) - A 15-year-old Indonesian girl who was raped by her older brother and then sentenced to jail for having an abortion has been freed, a court spokesman said on Monday (Aug 27).

The case drew international headlines and was slammed by rights groups, which have frequently criticised the nation's restrictive abortion laws.

The teenager from Jambi province on Sumatra island was sentenced to six months' jail last month alongside her 17-year-old brother, who was given a two-year term for sexually assaulting a minor.

But the Jambi High Court on Monday agreed to drop the abortion charge against the teenager following an appeal by her lawyers.

"The panel of judges said (the defendant) was proven to have had an abortion, but it was done under forced circumstances," said court spokesman Hasoloan Sianturi.

Abortion is illegal in Indonesia unless a woman's life is at risk or under certain circumstances if she is raped.

The law requires that an abortion must be performed by a registered professional no later than six weeks into a pregnancy, and the woman must undergo counselling.

The girl, who was raped repeatedly by her brother, had the abortion about six months after becoming pregnant.

Ms Mirna Novita Amir, one of the teenager's lawyers, welcomed the decision, saying jail was not the place for a rape victim.

"I see a teenager that should not have been charged, but had to go to jail even though she was a victim of her older brother," she told AFP.

The girl will receive counselling for psychological trauma and eventually resume her schooling, Ms Amir added.

Police arrested the siblings in June after a male foetus was discovered at a local palm oil plantation.

Critics say Indonesia's abortion laws restrict women's rights to reproductive health and lead many to undertake dangerous abortions at illegal clinics.

Abortions account for between 30 and 50 per cent of maternal deaths in the country, according to a 2013 World Health Organisation report.