Sometimes, democracy wins.

Texas Gov. Greg Abbott (R) signed a law last night which significantly rolls back the state’s efforts to make it harder to cast a ballot. Though the state’s new voter ID law is not a total victory for supporters of voting rights, it is a major shift in the state’s law — brought about by the fact that the state repeatedly lost its efforts to defend its previous law in court.

All voter ID laws are, to some extent, voter suppression laws. They make it harder to vote, while addressing a problem — voter impersonation fraud at the polls — that is virtually non-existent. Twenty million Texas votes were cast in the ten year period before the state enacted its voter ID law in 2011, but only two people were convicted of the kind of fraud that is supposedly targeted by such a law.

Indeed, Texas’ 2011 voter ID law doesn’t even try very hard to pretend that it exists for some purpose other than keeping certain people from casting a ballot. The law permitted voters to cast a ballot if they showed a gun permit (something Republicans are more likely to carry than Democrats), but it didn’t allow someone to vote with a student ID (students are especially likely to favor Democrats). A federal court also found that the law was “passed, at least in part, with a discriminatory intent in violation of the Voting Rights Act of 1965.”

After a conservative federal appeals court rejected Texas’s 2011 law, Texas agreed to be bound by a court order limiting its ability to enforce the law during the 2016 election. Under that court order, registered voters who “present a valid voter registration certificate, a certified birth certificate, a current utility bill, a bank statement, a government check, a paycheck, or any other government document that displays the voter’s name and address” may cast a regular ballot if they “sign a reasonable impediment declaration” — a document stating that the voter was not reasonably able to obtain the forms of ID mandated by the 2011 law.

The bill signed into law by Gov. Abbott on Thursday night mirrors much of this court order, making similar restrictions on the Texas voter ID law permanent.

Again, this is not a total victory for voting rights. The law still imposes an ID requirement on most voters, and some voters may be intimidated by the fact that they risk jail time if they make a false statement on their declaration of reasonable impediment.

Texas also filed court documents Thursday night claiming that its changes to its voter ID law should erase the federal court’s finding that the state acted with racially discriminatory intent. If the courts ultimately agree with this argument, that will limit the remedies available to voting rights advocates who want to ensure that Texas does not engage in additional voter suppression.

But the new Texas law also locks in place restrictions on the state’s voter suppression efforts that it could have just as easily fought in court. The Supreme Court, which once again has a Republican majority, signaled that it is eager to expand states’ ability to enact voter suppression laws. Texas could have fought for their 2011 law in the Supreme Court, and there’s a very good chance that the state would have won.

Instead, the state elected to take a partial loss rather than pushing on for a full victory. It’s unclear whether it will retain that posture if the Supreme Court eventually does legalize new forms of voter suppression. For the time being, however, Texas’ efforts to suppress the vote are hobbled, if not entirely dead.