Sushila Bishnoi, 19, appealed to a court in Rajasthan state to dissolve her underage marriage, an illegal but rife tradition in many parts of rural India. But her husband denied the couple were ever betrothed, threatening to scuttle her case.
The teenager, aided by an activist, trawled her husband's Facebook accounts until they found the smoking gun that proved their marriage occurred when she was underage.
"Many of his friends had posted congratulatory messages on his Facebook page," said Kriti Bharti, an activist whose Sarathi Trust charity has annulled many child marriages in Rajasthan.
"The court accepted the evidence and declared the marriage invalid," she said of the ruling Monday.
The couple were married at a secret wedding ceremony in Barmer district in 2010 when both were just 12 years old. Girls married off in Rajasthan often remain with their parents after the wedding ceremony until reaching 18 years of age, when they are sent to live their husbands.
Bishnoi said her parents were forcing her to move to her husband's house and consummate the marriage. "I wanted to study but my family and my in-laws wanted me to live with a drunkard," said Bishnoi.
"It was about life and death, and I chose to live."
She ran away from home to a shelter where she met Bharti, who helped her begin legal proceedings to dissolve the union.
India's highest court on Wednesday declared sex with a minor akin to rape even if the couple was married, a landmark ruling that closed a legal loophole around child marriage.
Nearly half of all girls in South Asia marry before 18 years of age, according to a UNICEF report released in 2014.