The Supreme Court on Monday ruled that states can count mail ballots that are cast by Election Day but arrive later, rejecting a GOP challenge to a Mississippi law.

In a surprise decision across ideological lines, the Supreme Court is saving a grace period for ballots received after Election Day.

The court’s ruling means state laws that allow ballots to be received after Election Day can stand.