The Supreme Court’s ruling letting more than a dozen states keep their post-election grace periods for mail ballots is a defeat for President Donald Trump and Republicans ahead of the midterms, but the GOP can still capture significant victories in major election-related cases coming farther down the pipeline.

In a 5-4 decision, the Court said states can allow post–Election Day receipt of mail ballots. It will boost Trump’s crusade for the SAVE America Act.

In a crucial victory for democracy, the US Supreme Court ruled that states can count ballots received after Election Day if postmarked on time.