Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A Texas woman was sentenced to five years behind bars this week for voting illegally in the 2016 election while on supervised release from federal prison.

Crystal Mason, 43, testified in court that she did not know that she was ineligible to vote due to her 2011 fraud conviction before casting a provisional ballot in the presidential election. In Texas, knowingly voting illegally is a second-degree felony, punishable by up to 20 years in prison.

Crystal Mason was sentenced to a five year prison sentence this week, after she tried to vote while on supervised release from federal prison, in Tarrant County, Texas. Tarrant County Jail

"A second degree felony for voting illegally? That's outrageous," J. Warren St. John, her defense attorney, told NBC News on Friday. "The punishment does not fit this crime."

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Texas' ballot asks voters to certify that they have completed their sentences — including supervision — if they have previously been convicted of a felony. Mason testified in court that she did not read the fine print because an election worker was helping her with the provisional ballot.

"She voted in good faith," St. John said, noting that she accurately filled out her own information and wasn't trying to obscure her identity. "She didn’t intentionally vote illegally and that’s the whole issue."

Mason had pleaded guilty in 2011 to inflating tax returns while working as a tax preparer and was sentenced to 60 months in federal prison, according to her attorney. She had served roughly three years before being released in 2016.

St. John said that Mason was never told in court, prison, or her halfway house that she couldn't vote until the entirety of her sentence was complete. Her probation officer also testified in court that he had not told her she couldn't vote.

Mason is appealing the judge's ruling, and out on bond pending that appeal. Because the crime is also a violation of her supervised release, she could still be arrested by federal authorities and sentenced to additional federal jail time for violating the terms of her release. St. John said federal court had not yet issued a warrant over the violation, however.

Mason is not the first to receive a severe sentence for voting illegally. A Texas resident and Mexican citizen with a green card, Rosa Maria Ortega, was sentenced to eight years in prison for casting an illegal ballot. Ortega had even served as a poll worker, and she, too, reportedly said she did not know she couldn’t vote.

Still, not everyone gets hard time. A North Carolina prosecutor declined to bring charges against a woman who said she cast an illegal vote for Donald Trump in order to fulfill her mother's dying wish. "She made a mistake out of sheer ignorance without any intent to defraud or commit a crime," the prosecutor said, according to a local report.

An estimated 6.1 million Americans are disenfranchised by a felony conviction, something many states are rethinking as those numbers continue to rise alongside skyrocketing incarceration rates.