Ms. Ortega, a native of Monterrey, Mexico, came to Texas with her mother when she was an infant. More than a decade later, the family was scattered after the mother was arrested and deported. Two brothers born in Dallas automatically gained citizenship; Ms. Ortega became a permanent resident and gained a green card, her brother Tony Ortega, 35, said in an interview.

As a Dallas County resident, she registered to vote and later cast ballots in elections in 2012 and 2014, her lawyer, Mr. Birdsall, said. While that was illegal, there was no attempt to break the law, he maintained: Some government forms allow applicants to declare that they are permanent residents, but the voting registration form asks only whether an applicant is a citizen.

Lacking the permanent resident option, he said, she ticked the “citizen” box. When the county later mailed her a registration card, he said, she believed she “was good to go.”

Ms. Ortega moved to neighboring Tarrant County and again registered, but this time checked a box affirming that she was not a citizen. When her application was rejected in March 2015, the trial showed, she called election officials and told them that she had previously voted in Dallas County without difficulty.

Told that she could not vote unless she was a citizen, she asked for another application, and returned it with a check in the box affirming citizenship. That raised questions, and law enforcement officials arrested her on fraud charges.

Jonathan White, an assistant attorney general who helped prosecute the Ortega case with Tarrant County officials, said the evidence of fraud was unambiguous. “She told the elections office she was a citizen,” he said. “She told everyone else she wasn’t,” including a recorded statement to prosecutors in which she said she was a citizen of Mexico.