The Supreme Court left intact a century-old exception to the Fifth Amendment’s double jeopardy clause that permits a state and the federal government to prosecute a person for the same criminal offense.

The court ruled 7-2 Monday in declining to overturn the"separate sovereigns doctrine, with Justice Samuel Alito delivering the opinion of the court. Justices Ruth Bader Ginsburg and Neil Gorsuch dissented.

The case before the high court involved a challenge to the Supreme Court’s separate sovereigns doctrine, an exception to the Fifth Amendment’s double jeopardy clause, which states no one can be “subject for the same offense to be twice put in jeopardy of life and limb.” Under the separate sovereigns exception, however, a person can be prosecuted in state and federal courts for the same criminal conduct because the states are separate sovereigns.

The man at the center of the legal challenge is Terance Gamble, who was pulled over for a broken tail light in Mobile, Ala., in 2015. Police smelled marijuana during the traffic stop and, upon searching the vehicle, found the drug, a digital scale, and 9-millimeter handgun, according to court filings.

The state of Alabama prosecuted Gamble for possessing the marijuana, and the state and federal government charged him with being a felon in possession of a firearm.

Gamble sought to have the federal charge tossed out and argued his Fifth Amendment right had been violated.

The federal district court, however, ruled against Gamble, citing the long-held doctrine allowing for dual prosecutions, and the 11th U.S. Circuit Court of Appeals agreed.

The Supreme Court agreed in June to review the lower court’s ruling, and during oral arguments in December, several justices seemed reluctant to overturning the separate sovereigns exception.

Writing for the majority, Alito said the "historical evidence" assembled by Gamble in favor of expanding double jeopardy protections is "feeble."

"Pointing the other way are the clause's text, other historical evidence, and 170 years of precedent," he wrote.

But Ginsburg knocked the separate sovereigns doctrine as "misguided" and wrote the double jeopardy clause bars successive prosecutions.

The separate sovereigns doctrine, Ginsburg wrote, "has been subject to relentless criticisms by members of the bench, bar and academy. Nevertheless, the court reaffirms the doctrine, thereby diminishing the individual rights shielded by the Double Jeopardy Clause. Different parts of the 'whole' United States should not be positioned to prosecute a defendant a second time for the same offense."

Gorsuch, meanwhile, wrote in a separate dissenting opinion that the separate sovereigns exception "finds no meaningful support in the text of the Constitution, its original public meaning, structure, or history."

"When governments may unleash all their might in multiple prosecutions against an individual, exhausting themselves only when those who hold the reins of power are content with the result, it is 'the poor and the weak' and the unpopular and controversial, who suffer first — and there is nothing to stop them from being last," Gorsuch said. "The separate sovereigns exception was wrong when it was invented, and it remains wrong today."

The case came to the justices against the backdrop of special counsel Robert Mueller’s 22-month investigation into Russian meddling in the 2016 election, which concluded in March.

The probe resulted in guilty pleas for five associates close to President Trump, including Trump’s former campaign chairman Paul Manafort. Some believed the Supreme Court case could have implications for those ensnared in Mueller’s investigation if they received a pardon from the president, which only applies to federal charges.

Manafort was found guilty last year on eight counts of financial crimes in the first trial stemming from Mueller’s probe. He was subsequently sentenced to more than seven years in prison for federal crimes including bank and tax fraud.

Not only was Manafort charged by federal prosecutors, but in March, a grand jury in New York indicted the longtime political consultant on 16 state felony charges, including residential mortgage fraud.