The Supreme Court unanimously slapped some badly needed handcuffs on state and local governments Wednesday by ruling that they’re subject to the US Constitution’s ban on “excessive fines.”

The justices found that the ban must apply to states because it’s “fundamental to our scheme of ordered liberty” and “deeply rooted” in US law, history and tradition.

Indeed, Justice Ruth Bader Ginsburg noted that prohibitions on excess fines go back to the days of the Magna Carta in 1215. And for good reason: They can be wrongly used “to retaliate against or chill the speech of political enemies” or as “a source of revenue” out of line with “the penal goals of retribution and deterrence.”

In the case before the court, Tyson Timbs pleaded guilty to selling less than $400 worth of heroin and was sentenced to a year of home detention, five years probation and fees of $1,203. Yet Indiana also demanded he also forfeit the Land Rover it said he’d used in the sale.

Talk about punishment not fitting the crime: The car’s value, $42,000, was more than four times the $10,000 maximum legal financial penalty, as the trial court noted in denying the state’s request. Yet Indiana’s Supreme Court reversed that decision, claiming the Eighth Amendment’s Excessive Fines Clause didn’t apply to states.

Fact is, state and local governments have long abused their power to fine people, even those not yet convicted, and confiscate property. After the death of Michael Brown in Ferguson, Mo., it was revealed that a full fifth of that city’s revenues came from court fines. Officials basically admitted they’d relied on them to finance their government — one of the very abuses Ginsburg flagged.

And some cases amount to downright theft: Wayne County, Mich., for example, grabbed a 2015 Kia Soul when its owner was found with just $10 worth of pot.

Now officials are on notice: Slapping excessive fines, even on criminals, makes the government just as guilty as them.