An American woman is fighting Saudi Arabia for custody of her 4-year-old daughter after a Saudi judge ruled that she was too Western to be a suitable parent.

“It's like a nightmare that just won't stop," said the woman's aunt, Marlene Vierra.

Her niece, Bethany Vierra, moved to the Gulf Kingdom after marrying a Saudi citizen in Portugal. But after the marriage turned sour, Bethany Vierra fought for custody of her daughter Zaina — a battle she lost last month.

"They found Bethany not suitable to be a mother of Zaina because she was too Western," Marlene Vierra told NBC News.

The judge awarded custody to Bethany Vierra's former mother-in-law. Vierra, 32, from Washington state, is appealing the decision.

In a desperate Facebook post on Aug. 7, she said that she and her daughter had suffered abuse but she was the one who was still being punished by the courts. She also claimed that the Saudi Ministry of Justice had barred her from leaving Saudi Arabia for 10 years and that Saudi authorities had issued a warrant for her arrest.

“What is my crime? Doing a handstand? Not being Saudi? Not covering my body while I was on vacation in the United States of America?” she wrote in the post.

“There aren’t many things I do well, but being mother to Zaina is one thing I know that I was divinely designed to be,” she wrote. “She’s my everything, my purpose, my sidekick and my joy.”

Vierra did not name her estranged husband and NBC News could not immediately confirm the ruling or get in touch with him. The Saudi Ministry of Justice did not immediately respond to requests for comment.

Vierra said on Facebook that her daughter was now having nightmares and cries every time she leaves the room because she is afraid she could be taken away.

Marlene Vierra said her niece's family was being torn apart.

“I think about that 4-year-old-little girl and what she's going through, and she doesn't understand it," she said. "She sees her mom upset, and Bethany will not leave her daughter, she will fight for her."

Bethany Vierra and her daughter, Zeina.

Asked about the case in March, a State Department official said the department was aware of reports of a U.S. citizen unable to leave Saudi Arabia with her daughter. "We stand ready to provide all appropriate consular services in cases to U.S. citizens abroad," the official added.

The case comes at a time when Saudi Arabia's position on women's rights appears to be changing.

This month, the kingdom published new laws loosening restrictions on women by allowing any citizen to apply for a passport and travel freely, ending a long-standing guardianship policy that gave men control over women. Previously, women were required to have a man's consent to obtain a passport or travel abroad.

Other changes issued in the decrees allow women to register a marriage, divorce or child's birth and to be issued official family documents. It also stipulates that a mother can be legal guardians of children as well as a father.

The legal system has long been criticized because it treated women as minors throughout their adult lives.

Still in place, however, are rules that require male consent for a woman to leave prison, exit a domestic abuse shelter or marry. Women, unlike men, cannot pass on citizenship to their children and cannot provide consent for their children to marry.