By Jim Forsyth

SAN ANTONIO (Reuters) - A Texas court on Wednesday exonerated four women convicted of sexual assault in the 1990s after lawyers argued that they were sent to prison because of junk science, tainted testimony and false ideas of lesbian behavior.

The Court of Criminal Appeals said the convictions of the so-called "San Antonio Four" for sexually assaulting two children, ages 7 and 9, did not pass "the smell test." With testimony recanted since the trial and new evidence, no reasonable juror could have found the women guilty, the court said.

"Those defendants have won the right to proclaim to the citizens of Texas that they did not commit a crime," the written ruling said. "They are innocent. And they are exonerated."

Cassandra Rivera, Elizabeth Ramirez, Kristie Mayhugh and Anna Vasquez were sentenced to prison terms ranging from 15 to 37 years and each served more than a decade. They were released on bond a few years ago as the convictions began to unravel.

"They are overjoyed at the decision. They will all be having great Thanksgivings," said Mike Ware an attorney with Innocence Project of Texas and the lead appellate counsel for the four.

The four maintained their innocence and their supporters have slammed testimony presented by the state's star medical witness at trial, pediatrician Nancy Kellogg.

Kellogg testified about what she said were physical injuries inflicted upon the girls as part of satanic rituals that she said were prevalent among some lesbians.

Kellogg later retracted her testimony and agreed with defense claims that there were no signs of physical abuse, the appeals court said.

Other witnesses in the original trials also recanted their testimony.

"Today's ruling prevents any further prosecution of these cases. I pray peace and a new beginning for them," Bexar County Criminal District Attorney Nico LaHood said in a statement about the four women.

The convictions in Texas were part of a national trend in the 1980s and early 1990s triggered by sensational accusations of satanic rituals and the sexual abuse of hundreds of children at a California preschool in what was known as the McMartin case.

The case, then dubbed the most expensive criminal trial in U.S. history, ended with no convictions.

With the exonerations in Texas, the four women are in line for compensation under state law.

(Reporting by Jim Forsyth and Jon Herskovitz; editing by Grant McCool)