Mayra Figueroa and Teodora del Carmen Vásquez first met in the fourth grade classroom in El Salvador’s notorious Ilopango women’s prison. Although both had attended school through third grade in rural El Salvador, class typically meets only two hours a day and there are no books and classrooms until the third grade. So when Figueroa and Carmen Vásquez arrived in prison, they didn't know how to read.

But that’s not the only thing they had in common. What they didn’t know until years later was that Figueroa and Carmen Vásquez were in for the same charge.

Mayra Figueroa, right, and Teadora del Carmen Vasquez, left, met in the fourth grade and again in El Salvador's Ilopango the woman's prison. Credit: Courtesy of Sarah Garcia Gross

El Salvador is one of just a handful of countries where abortion is banned in all circumstances. The ban is so draconian that even miscarriage is considered suspicious.

Currently, there are 23 Salvadoran women who say they suffered a miscarriage and are now serving lengthy jail terms.

Twenty-five others have been released after activists intervened on their behalf, citing a lack of evidence that they'd sought abortions. Figueroa and Carmen Vásquez were among them.

Related: As more women are incarcerated in Mexico, so are their babies

Figueroa, who was a domestic worker, was also in prison after a pregnancy that did not go full term. She says she was raped by her employer's nephew while at work and after she had contractions one day on the job, her employers took her to the hospital. The baby did not survive and someone reported Figueroa to the police saying she'd tried to abort her baby.

“I was in the hospital with handcuffs and a man said to me, 'You are so-and-so?' I said, "Yes." 'You are being detained because you killed your son,’” recounted Figaro. “'What?!' I responded.”

Carmen Vásquez's story is pretty similar. She was sentenced to 30 years for aggravated homicide after suffering a stillbirth in a bathroom.

“I was walking back to the school with the person [who] was going to help me and some people said to me, 'What we found in the bathroom, who does it belong to?' "It is mine," I said. 'My baby had to be born here,’” Carmen Vásquez remembered. “'No, you killed it,' they said to me. "You killed it."”

Related: Women filling Mexico's prisons are the 'lowest rungs of the drug trade'

Carmen Vásquez took out her phone to show them she had called 911.

“They arrested me anyway and told me they were going to interrogate me and that I will be sentenced to 30 to 55 years in prison,” she said.

Author of “Her Body, Our Laws” Michelle Oberman, who is also a lawyer, spent time with Figueroa and Carmen Vásquez. She was able to visit the prison where they were detained and met 10 of the 23 women who are still in Ilopango for these crimes.

“All of them are marked by the same basic facts,” explained Oberman. “They experienced late-term pregnancy losses. Typically they arrive for emergency care in a hospital where the health care providers, the police and then later the prosecutors and the judges, begin to suspect that because of their deep poverty they must not have wanted to have these babies.”

Oberman said that the women she spoke to didn't have abortions and didn't want to lose their pregnancies. Suspicions arise when a woman arrives having lost a later pregnancy.

“Then you've got some evidence that there was a pregnancy, that there is a dead baby or a dead fetus. And that suspicion gets taken up by the authorities,” said Oberman.

Related: A US-style drug war brings a terrible cost: Thai prisons packed full of women

She explained that in cases of extreme poverty everything “goes sideways.” Decent legal representation isn’t accessible to these women, she said.

“The stories that people are willing to believe because that's a life that is so distinct from theirs — the stories in the media, the stories in the courtroom, the stories even among the guards in the prison are stories of monsters that did something deliberately to kill their babies,” Oberman said.

After activists visited the prison and brought it to their attention, 17 of the women accused learned that they were all in for the same crime. They bonded together to protect one another and they were eventually able to stop the beatings.

Mayra Figueroa, left, author Michelle Oberman, center, and Teadora del Carmen Vasquez. Figueroa and Vasquez were both imprisoned in El Salvador for what they say were miscarriages. Courts later released the two women, citing lack of evidence. Credit: Courtesy of Sarah Garcia Gross

Figueroa and Carmen Vásquez have not forgotten about the women they've left behind.

“At least people could help us so the other women can get out," Figueroa said. "Maybe they can support us because since we got freed the other ones could too."

Oberman was there when Mayra Figueroa and Teadora del Carmen Vásquez saw each other for the first time after they left prison in the spring.

“[We] plowed up the road until we saw Mayra walking down toward us,” she said. “And then Teadora, who hadn't seen her since they left prison earlier that spring, jumped out of a car and raced to her. And it was beautiful."

Related: Here's a list of ways to help women who've been incarcerated