The test involves a medical examiner inserting two fingers into a woman's vagina to determine her virginity. According to the World Health Organization, the procedure holds no scientific merit.
The Lahore High Court judges ruled the practice "offends the personal dignity of the female victim and therefore is against the right to life and right to dignity."
In March, rights activists filed a case against the practice and demanded that it be outlawed. A similar case is being heard in the Sindh High Court and women's rights activists hope the Lahore court ruling will set a precedent for a nationwide ban.
Neighboring India banned the "two-finger" test in 2013, and Bangladesh followed suit in 2018.
Psychological torture and trauma
Rape victims describe the test as a "second trauma" after the sexual assault, which leaves psychological scars.
Mukhtaran Mai, a rights activist who survived a gang rape in 2002, told DW that the test discouraged women from reporting sexual assaults. "It is used to humiliate women in courts," Mai said. "I also went through it, and I cannot describe the humiliation."
"It feels like a second trauma," Mai said. "From the police station to hospital, everyone stares at you."
Even after a rape victim goes through the test, Mai said, police could still manipulate its result, which creates more problems for victims.
Setting a precedent
Sexual crimes against women are widespread in the South Asian country, with recent rape cases in public places causing huge uproar in society.
Rape victims often face social stigma, and sexual assaults are vastly underreported in the country. The Human Rights Commission of Pakistan says that weak laws and complicated procedures for prosecution make it difficult to punish the culprits.
Sahar Bandial, one of the lawyers who filed the petition against intrusive rape tests, told DW that the practice is a violation of a woman's body. "It is character assassination. The victim's testimony is discredited in the court of law. The test is a violation of human dignity, the right to life, the right to medical care. In short, it is discriminatory," Bandial said.
Activists and lawyers took the case to the Lahore High Court because the Parliament would not abolish the practice, Bandial said. "It is not a law," she added. "It is a decadeslong practice."
Although the court's decision applies only to Punjab, Bandial said, it is likely to set a precedent for other provinces.
The rights activist Farzana Bari hailed the court's decision and told DW that other anti-women laws need to be abolished, as well. "For instance, the woman's age is discredited in adultery cases, and a woman's testimony is not considered equal to that of a man's in rape and gang rapes cases," she said. "These laws must be scrapped."
Bushra Gohar, a former parliamentarian, says she hopes that the government will implement the court's decision at all levels.
Rising rape cases
Pakistan ranks sixth on the list of the world's most dangerous countries for women. Since 2015, more than 22,037 rape cases have been reported in the country, according to government data. Activists say it is just the tip of an iceberg as a large number of rape cases are not reported in the country.
The conviction rate in rape cases is also very low. Out of the 22,037 rape cases, 4,060 are pending in courts, while only 77 offenders have been convicted.
On September 9, two men dragged a woman and her children out of their car on a highway, raped her in front of her kids and robbed her. The incident took place near the eastern city of Lahore.
A call for help to police did not receive a response, a family member said. Lahore's former police chief, Umer Sheikh, sparked an uproar after he said that the crime was the woman's fault as she left the house at night and drove on an empty road.
Amid public outrage, the government last month approved chemical castration and death penalty as part of a new anti-rape law. Rights groups have criticized the legislation as regressive, saying it would not solve Pakistan's rape problem.