A man walks up the steps of the U.S. Supreme Court on January 31, 2017 in Washington, DC.

The Supreme Court on Monday refused to overturn a longstanding rule that allows individuals to be charged by states and the federal government for the same offense.

In a 7-2 ruling, the justices affirmed the so-called "dual sovereignty" exception to the Constitution's double jeopardy clause. The opinion was authored by Justice Samuel Alito, who wrote that the rule is "not an exception at all."

The Fifth Amendment's double jeopardy clause states that "No person shall [...] be subject for the same offense to be twice put in jeopardy of life or limb." Alito wrote that because states and the federal government are both sovereign governments, a violation of state and federal law is not the "same offense," but is instead separate offenses.

Justices Ruth Bader Ginsburg and Neil Gorsuch, in separate dissents, took issue with the majority's formula.

In her dissent, Ginsburg wrote that under the Constitution, it is the governed, not the governments, who are the ultimate sovereigns.

In his dissent, Gorsuch wrote that a "free society does not allow its government to try the same individual for the same crime until it's happy with the result."