The U.S. Supreme Court is upholding a constitutional rule that allows state and federal governments to prosecute someone for the same crime.

The court’s 7-2 decision Monday preserves a long-standing exception to the Constitution’s ban on trying someone twice for the same offence.

The case had been closely watched because a ruling for the defendant in this case might have made it harder for states to pursue criminal charges against defendants in the Russia investigation in the event they are pardoned by President Donald Trump.

The court ruled against federal prison inmate Terance Gamble. He was prosecuted by Alabama and by the federal government for having a gun after an earlier conviction for robbery.

Justice Samuel Alito wrote in his majority opinion that 170 years of precedent supports the idea that “a state may prosecute a defendant under state law even if the federal government has prosecuted him for the same conduct under a federal statute.”

A free society does not allow its government to try the same individual for the same crime until it’s happy with the result.– Supreme Court Justice Neil Gorsuch, who dissented

New York state authorities already have indicted Paul Manafort, Trump’s former campaign chairman.

Manafort has been sentenced to more than seven years on federal conspiracy and fraud convictions. He also has been charged with mortgage fraud and other crimes in New York.

Trump could pardon him for his federal convictions, but Manafort still would have to answer to the state charges by the Manhattan district attorney’s office. Trump has used his pardon power in certain instances for supporters or sympathizers, including writers Conrad Black and Dinesh D’Souza, and controversial former Arizona sheriff Joe Arpaio.

The president’s pardon power doesn’t extend to state charges.

Had the justices ruled the other way, it might have called into question the ability to prosecute Manafort on the state level.

Trump’s former personal attorney, Michael Cohen, was prosecuted at the state level and sentenced to prison on charges that included tax evasion and making an illegal campaign finance contribution.

Thomas changes course from ‘initial skepticism’

The case decided Monday drew the court’s attention after Justices Ruth Bader Ginsburg and Clarence Thomas wrote in 2016 that the exception to protection from double jeopardy should be reconsidered.

But during arguments in December, several justices worried about the practical effects of ruling for Gamble. Justice Stephen Breyer pointed to federal prosecutions for crimes of racial violence and domestic violence against Native American women that could be imperilled if Gamble prevailed.

Ginsburg dissented from Monday’s ruling, which she called “adherence to that misguided doctrine.” In a separate dissent, Justice Neil Gorsuch wrote, “A free society does not allow its government to try the same individual for the same crime until it’s happy with the result.”

In the end, Thomas parted ways with Ginsburg. He noted in a 17-page opinion that “the historical record does not bear out my initial skepticism.”

Thomas spent the bulk of his opinion making the case for less fidelity to Supreme Court precedents.

“When faced with a demonstrably erroneous precedent, my rule is simple: We should not follow it,” wrote the justice who is the most likely to encourage his colleagues to overrule earlier high court decisions.