Image copyright AFP Image caption A woman with a "bad habit" cannot join the Indonesian military, a spokesman said

Human rights activists have urged Indonesia to stop requiring female military recruits to undergo so-called virginity testing.

Human Rights Watch (HRW) said the hymen examinations were "harmful and humiliating'. Another group said they may amount to torture.

The Indonesian military has defended the tests, saying they stop immoral women from entering the armed forces.

Indonesia's police faced criticism last year for requiring the examinations.

As well as HRW, the International Rehabilitation Council for Torture Victims (IRCT) also spoke out about the practice ahead of a conference on military medicine in Bali, Indonesia.

IRCT described the testing as "a gross violation of women's rights and one that may amount to ill-treatment and torture under international law".

Both organisations also claimed that the fiancees of male officers were required to be examined before the marriage could go ahead, though the armed forces told AFP that this was not the case.

Image copyright AFP Image caption Indonesians commemorate a women's rights pioneer on Kartini Day

'Bad habit'

A spokesman for Indonesia's military, Fuad Basya, told the BBC the test was "still relevant".

He said he understood why some non-virgins should seek to join the military, adding: "It may be because of an accident, disease or because of a habit" - meaning sexual intercourse.

"If it is their habit, the Indonesian military cannot accept potential recruits like these," Mr Basya said.

Image copyright AFP Image caption Indonesia also requires female police recruits to undergo "virginity testing"

The World Health Organization regards virginity tests as a form of sexual violence. It also says the practice has no scientific validity.

There are many reasons why a woman's hymen (a membrane which partially covers the vaginal opening) may not appear "intact" on examination.

After widespread condemnation in 2014 of the Indonesian police force's use of the practice for recruits, the government said it would no longer require women enrolling at a college for civil servants to undergo the examination.

A local plan to require schoolgirls in part of Java to undergo the so-called virginity tests before they could gain a secondary school diploma was scrapped after an outcry earlier this year.