MPs have backed a ban on virginity testing in England, after the government called it “indefensible”.
Anyone helping girls or women get the tests, which includes an intrusive vaginal examination, could face up to five years in prison.
Health Minister Edward Argar told the House of Commons the practice was “repressive” and caused “long-term physical and psychological damage”.
The World Health Organisation says it is a violation of human rights.
It adds that the tests, thought to occur in at least 20 countries, cannot prove whether a woman or girl has had sex or not, as the hymen can be broken in other ways – such as through tampon use or exercise.
But a BBC Newsbeat investigation last year found 21 clinics in the UK offering them, at a cost of between £150 and £300.
An amendment to the Health and Care Bill banning virginity tests was passed unopposed by the Commons.
This would make it a criminal offence to offer someone from England a test, or help them get one in the UK or abroad.
The maximum penalty would be a five-year jail sentence or an unlimited fine.
Mr Argar said the ban had been discussed with ministers in Scotland, Wales and Northern Ireland, who all wanted to “ensure the whole of the UK together tackles this abhorrent practice”.
Creating a criminal offence would “begin to tackle the harmful misconceptions that surround a woman’s sexuality”, he argued.
Mr Argar added: “This House’s commitment to legislate, I believe, is a profoundly important step forward in helping to tackle the damaging myths concerning so-called purity in women’s sexuality.
“In response to concerns that vulnerable women and girls will be taken abroad and subjected to virginity testing abroad once the offence is banned in the UK, these offences will also carry extra-territorial jurisdiction.”
Campaigners have also said they want a ban on hymenoplasty, a practice involving cosmetic surgery to reconstruct the hymen.
The government has indicated it wants to outlaw this as well, but it is awaiting the recommendations of an independent panel which is due to report back before Christmas.