KABUL, Afghanistan — The teenage girl had barely survived an attempted mob lynching in Kabul. The police responded by forcing her to undergo a virginity examination.

An unproved accusation of adultery had sent the mob chasing the girl and the young man she had been linked to, and the crowd set fire to the car in which the two were found last July in west Kabul. They barely escaped, but the police seemed more concerned about the mob’s accusation. They chased her down and arrested her hours later.

“Since there was suspicion of sexual relationship, the police sent the girl to forensic medical for virginity test,” Fraidoon Obaidi, chief of the Kabul Police Criminal Investigation Department, said after her arrest.

That was months after President Ashraf Ghani had promised rights activists that forensic virginity tests — an invasive examination to check whether the hymen is intact — would be abolished as an official procedure. And it was years after studies and human rights groups had discredited the practice entirely, finding it invalid and tantamount to sexual abuse.