Education chief Muhammad Rasyid, of Prabumulih district in south Sumatra put forward the idea, describing it as "an accurate way to protect children from prostitution and free sex". He said he would use the city budget to begin tests early next year if MPs approved the proposal.

"This is for their own good," Rasyid said. "Every woman has the right to virginity … we expect students not to commit negative acts."

The test would require female senior school students aged 16 to 19 to have their hymen examined every year until graduation. Boys, however, would undergo no investigation into whether they had had sex.

The plan has met with some support from local politicians, who said the test would help cut down on "rampant" promiscuity in the district.

"Virginity is sacred, thus it's a disgrace for a [female] student to lose her virginity before getting married," Hasrul Azwar of the Islamist Prosperous Justice Party (PKS) told the Jakarta Post.