The Supreme Court on Tuesday refused to block a key provision of North Dakota’s voter ID requirement, ensuring that the law will be in effect during the 2018 midterm election. As Justice Ruth Bader Ginsburg pointed out in her dissent, this decision is bad news for the thousands of voters who may now be unable to cast a ballot in November. It’s also terrible news for Sen. Heidi Heitkamp, a Democrat defending her seat against Rep. Kevin Cramer, a Republican challenger who’s ahead in the polls. By design, North Dakota’s law disproportionately disenfranchises Native American voters, who lean Democratic. Tuesday’s ruling could swing the election toward Cramer—and deny Democrats control over the Senate.

Until recently, voting in North Dakota was relatively easy. The state has no voter registration; historically, residents could simply show up at the polls and provide some form of identification (no photo required). If they lacked ID, voters could sign an affidavit confirming their eligibility. The GOP-controlled Legislature began cracking down on suffrage shortly after Heitkamp eked out an unexpected victory in 2012, winning by fewer than 3,000 votes. Republicans introduced a stringent voter ID requirement, then scrapped the affidavit option. A federal district court blocked the new rules in 2016 as a likely equal-protection violation due to the massive burdens they placed on Native American voters. The Legislature tweaked the law in 2017, but the court again froze a large chunk of it in April, citing its “discriminatory and burdensome impact on Native Americans.”

Thanks to this decision, the most draconian components of North Dakota’s voter ID law were not in effect during the state’s June primary. In late September, however, the 8th Circuit Court of Appeals reversed the district court in a 2–1 decision. The appeals court allowed the state to implement the part of the law that compels voters to provide an ID that includes his or her current residential street address. This provision is controversial because it seems to directly target Native Americans. The U.S. Postal Service doesn’t provide residential delivery in rural reservations, so most tribal members use a P.O. box, which is listed as their address on tribal IDs. To remedy this problem, the district court had ordered the state to accept IDs that list a current mailing address. But the 8th Circuit scrapped that compromise, permitting the state to reject IDs that include a mailing address but no street address—that is, a huge number of tribal IDs.

How many, exactly? The district court found that at least 4,998 otherwise eligible Native Americans do not have an ID with a current street address. They are not alone: About 65,000 non–Native American voters also lack the necessary ID. The law does allow voters to provide “supplemental documentation” to prove their identity, such as a utility bill or bank statement. But once again, Native Americans are disproportionately unlikely to have these materials, due in part to poverty and homelessness within their communities. Thus, at least 2,305 Native Americans may not be allowed to cast a ballot in the 2018 election.

In theory, disenfranchised Native Americans can surmount these obstacles. The district court held that residents who lack the necessary ID must be allowed to vote if they present documentation from a tribal government, like a formal letter establishing their residency. And the state didn’t challenge this part of its ruling, allowing it to stand. But homeless and impoverished voters will surely struggle to obtain this paperwork in time for the election.

Despite these concerns, the Supreme Court declined to reverse the 8th Circuit, thereby authorizing the state to enforce its law in November. (Justice Brett Kavanaugh did not participate in the decision.) Writing in dissent, Ginsburg, joined by Justice Elena Kagan, raised the prospect of “grand-scale voter confusion.” This “all too real risk,” she wrote, is exacerbated by the fact that the requirements were not in place during June’s primary. Thousands of voters who could cast a ballot in June, Ginsburg noted, may now arrive at the polls and discover that their ID is no longer valid.

Most of these voters probably planned to vote for Heitkamp. And their votes matter: North Dakota residents have far more power than voters in any other state to determine control of the Senate. The suppression of just a few thousand Native American votes could entrench Republican rule over the chamber for two more years. If Heitkamp loses as narrowly in 2018 as she won in 2012, North Dakota Republicans’ assault on voting rights may well be to blame.