A woman who was sentenced to six months jail in Indonesia for recording her boss's sexual harassment has been granted an amnesty.

Baiq Nuril Maknun wept and lawmakers clapped as the country's parliament unanimously approved an amnesty recommended by the nation's president.

Maknun was a teacher on Lombok Island and began to receive lewd calls from the Principal of the school in 2012.

Baiq Nuril Maknun wept and lawmakers clapped as the country's parliament unanimously approved an amnesty recommended by the nation's president

Maknun hugs her son after lawmakers pardon her for recording her son sexually harassing her

A woman who was sentenced to six months jail in Indonesia for recording her boss's sexual harassment has been granted an amnesty

Maknun (centre) was a teacher on Lombok Island and began to receive lewd calls from the Principal of the school in 2012.

She decided to record some of them, distributing the audio to a third person.

The messages left for Maknun included him recalling sex acts he'd performed with another member of staff.

Though she didn't want to release the recordings, her friends convinced her to draw attention to his behaviour which was not limited to phone calls.

The Principal lost his job as a result and in 2015 he reported her to the police and she was tried under Indonesia's strict anti-pornography laws.

The teacher was cleared of charges by a Lombok judge but the decision of the smaller court was overturned by the Supreme Court, meaning she was not able to appeal again.

According to a court spokesman speaking to CNA, her case was thrown out because her crime 'has been legally and convincingly proven.'

Maknun was granted the amnesty after the Supreme Court rejected her appeal and did not have to serve time in prison.

The case became a #MeToo moment for Indonesia, a conservative nation that tolerates child marriage, has high levels of violence against women and imposes virginity tests on women who want to join the military or police.

Amnesty Internaional Indonesia's Executive Director Usman Hamid lauded the result as a historic victory for victims of sexual abuse in Indonesia.

Maknun (pictured) was granted the amnesty after the Supreme Court rejected her appeal and did not have to serve time in prison

In 2008, Indonesia passed its tough anti-pornography laws, backed largely by the country's Muslim hardliners.

Indonesians downloading or possessing 'indecent' material can be slapped with four years in prison.

Law and Human Rights Minister Yasonna Laoly told parliament that amnesty for Maknun was in line with Widodo's national development plan that includes protecting women from all kinds of violence.

'We can't turn a blind eye to this case,' Laoly said, 'It will only discourage women who experience similar cases from speaking up and fighting for their dignity.'