CHICAGO (AP) — The day Margarita Del Pilar Fitzpatrick applied for an Illinois driver’s license upended her life. When a clerk offered to register her to vote in 2005, the Peruvian citizen mistakenly accepted, leading to long legal battles and eventually deportation.

A decade and a half later, she struggles to find work at 52, is nearly homeless and hasn’t seen two of her three American citizen daughters in years because of a secretary of state’s office mishap.

“It has derailed our lives,” she said in a phone interview from Lima. “Immigrants should not be put in this situation.”

A handful of other immigrants could face a similar fate, or criminal charges, after a mistake in Illinois’ automatic voter registration system allowed of hundreds of people who identified themselves as non-U.S. citizens to register. Sixteen cast ballots.

The fiasco in a state with a reputation for election shenanigans triggered a partisan battle, infuriated voter advocacy groups and left immigrant rights activists doing damage control.

“It’s disappointing because the situation could have been avoided,” said Lawrence Benito, head of the Illinois Coalition for Immigrant and Refugee Rights. “They voluntarily told people they were noncitizens. It was not their fault.”

Voting by noncitizens is forbidden by state and federal laws and is statistically rare. But President Donald Trump has repeatedly made unsubstantiated claims that millions voted illegally in 2016. His comments gave a political charge to the issue and put voting modernization efforts such as automatic registration in the spotlight.

“The political appearance is terrible,” Jessica Levinson, a professor at Loyola Law School in Los Angeles, said of Illinois. “The political reality is people are looking for any potential sense of error when it comes to noncitizen voting to indicate that things like automatic voter registration give rise to fraud.”

READ MORE: American voters worry they can’t spot misleading information, poll finds

Illinois made headlines in 2017 when then-Gov. Bruce Rauner was among the first Republicans to sign automatic voter registration into law. The multi-faceted law focuses largely on the secretary of state’s office, which issues driver’s licenses.

A “programming error” wrongly sent data from more than 500 people to election officials, even though when asked if they were U.S. citizens, they hit “no” on an electronic keypad. Ultimately, 545 people were registered.

It’s unclear whether some people were confused and mistakenly hit “no.” About half of the voters appeared to be citizens. One was confirmed as a noncitizen with legal status to live in the U.S. Six others remain in question.

Whether that individual, or others yet to surface, could face criminal charges boils down the will of prosecutors.

Experts say there’s little chance of charges being filed around Chicago, where the Cook County state’s attorney is a Democrat.

However, authorities in more conservative pockets might be more inclined to act. Election officials said they have not been contacted by law enforcement.

Stepped-up efforts to crack down on noncitizen voters have netted results elsewhere. In 2018, a federal task force in North Carolina uncovered voting violations that led to charges against 19 foreign nationals related to the 2016 election.

It can take years for a noncitizen’s illegal vote to surface. Immigration authorities might not find out until an immigrant applies to adjust their status, like a green card holder seeking citizenship with a form that asks if the applicant has ever voted. An affirmative answer could disqualify the applicant and lead to deportation.

Two of the highest-profile cases, heard in the 7th Circuit Court of Appeals, also started with the Illinois secretary of state’s office, which has since changed how clerks discuss voter registration.

Fitzpatrick presented both her Peruvian passport and U.S. green card when applying for a driver’s license in 2005. She was confused by a clerk who said it was “up to you” if she wanted to register so she did. Then she voted, saying she did not learn it was illegal until applying for citizenship years later. The government moved to have her deported, which courts upheld. She was removed in 2017.

It was the opposite for Elizabeth Keathley, a Philippine citizen in the U.S. on a marriage visa. She applied for a driver’s license and was sent a registration card. She voted in 2006. In processing her green card, immigration authorities discovered she had voted, and she was ordered removed. However, judges determined she did not falsely represent herself, allowing her to stay. She’s since become a citizen, and her story was recounted in an off-Broadway play.

Keathley, 41, said the threat of being separated from her family was devastating, especially since her daughter was then an infant. She also lost her hospital job.

“Our lives were turned upside-down,” said the Bloomington woman.

READ MORE: Early state voters say they’re more swayed by basic issues than impeachment, Iran

Chicago attorney Richard Hanus represented both women. He believed Illinois’ error could work in their favor, since his clients did not misrepresent themselves as citizens.

Illinois officials vowed to protect immigrants, including fighting subpoenas.

Some voter rights advocates say the state law contains a caveat that could help. It says if a registration is wrongly processed “that person shall not be found on that basis to have made a false claim to citizenship.”

Noncitizen voting isn’t common. A 2017 study by the Brennan Center for Justice found roughly 30 incidents of suspected noncitizen voting when it looked at election jurisdictions representing nearly 24 million votes in the 2016 general election.

Secretary of State Jesse White said his office takes full blame and issued letters to the people affected explaining that. Immigrant-rights advocates want additional protections.

White also countered any insinuation of intentional wrongdoing.

“This was an error, and there was no effort put forth to hide anything or ‘to cook the books,’ so to speak,” White, a Democrat, said recently at a state Capitol hearing. He said the glitch, covering registrations from July 2018 through December 2019, was fixed.

Republicans have called for the system to be suspended after other registration glitches were made public. They’ve also pointed to issues with mistaken noncitizen voter registrations elsewhere, including California.

“The fundamental right to vote and the sanctity of our democracy is too important to bury our heads in the sand and trust that Illinois’ state government has everything under control when it clearly does not,” Illinois Republican Party Chairman Tim Schneider said after the error was made public last month.

Nearly 20 states have approved some form of automatic voter registration with the goal of increasing civic participation.

Aside from delays and technical issues, voter groups said repeated problems show Illinois has not done enough to safeguard the system.

The state has not “fully come to terms with the harm that can be caused with errors like this in our voting system,” said Ami Gandhi with the Chicago Lawyers’ Committee for Civil Rights.