The Texas Court of Criminal Appeals ruled Wednesday that the women known as the “San Antonio Four” be declared innocent and exonerated after almost 15 years in prison, KSAT 12 News reports.

The story of Elizabeth Ramirez, Kristie Mayhugh, Cassandra Rivera and Anna Vasquez – who were convicted in 1997 of attacking Ramirez’s nieces, ages 7 and 9 – was the subject of a recent documentary Southwest of Salem: The Story of the San Antonio Four, that aired on Investigation Discovery.

Rivera was convicted in December 1997 of sexual assault and sentenced to 37 years. Her friends were each sentenced in February 1998 to 15 years. Rivera was then paroled in 2012, but the other three women were released on bail in 2013 with the help of the Innocence Project of Texas following new evidence.

A judge earlier this year refused to void their convictions while ruling that each was entitled to a new trial.

Ramirez and three of her friends were accused of sexually assaulting her two nieces over a two-day period while Ramirez cared for the young girls at her apartment in San Antonio, Texas in 1994.

“I couldn’t believe it,” Ramirez told PEOPLE this year, recounting her ordeal. “I was like, where did they even come up with that? I was like in shock.”

Ramirez, then 19, was a fast-food restaurant worker who’d recently learned she was pregnant. Her friends, Anna Vasquez and Cassandra Rivera, were a lesbian couple raising Rivera’s two young children from a prior marriage. Like Ramirez, the fourth friend, Kristie Mayhugh, also was gay.

The women’s sexuality figured at trial, when prosecutors accused them of cult-like ritual abuse of the victims.

The ruling said Thursday: “They are innocent. And they are exonerated. This court grants them the relief they seek.”