WASHINGTON – The Supreme Court ruled unanimously Wednesday that states cannot impose excessive fees, fines and forfeitures as criminal penalties.

The decision, which united the court's conservatives and liberals, makes clear that the Eighth Amendment's prohibition against "excessive fines" applies to states and localities as well as the federal government.

Associate Justice Ruth Bader Ginsburg, just back in court this week after lung cancer surgery, wrote the majority opinion and announced it from the bench.

"The protection against excessive fines guards against abuses of government’s punitive or criminal law-enforcement authority," Ginsburg wrote. Quoting in part from the court's ruling in 2010 that Second Amendment gun rights apply to the states, she said, "This safeguard, we hold, is 'fundamental to our scheme of ordered liberty.' "

It was a victory for Tyson Timbs, who sold less than $400 worth of heroin to undercover police officers in 2013. Upon conviction, Indiana seized his Land Rover, which he had purchased for more than $42,000 with the proceeds of his father's life insurance policy. That seizure will be reconsidered by Indiana courts.

War or Peace:Does a 40-foot Latin cross honoring World War I veterans violate the Constitution? The Supreme Court will decide.

Liberals and libertarians alike have groused for years about what they see as increasingly greedy governments. A study by Harvard University and the National Institute of Justice found that about 10 million people owe more than $50 billion as a result of the fines, fees and forfeitures.

Start your day smarter:Get USA TODAY's Daily Briefing in your inbox

More:Enterprising town turns SC highways into rivers of cash

Many of the fines and forfeitures are contested and reduced. The court's ruling could cut down on their imposition in the first place.

State and local governments increasingly use funds collected in criminal and civil cases to pay for municipal services. The 100 cities with the highest proportion of revenue from fines and fees in 2012 financed 7 percent to 30 percent of their budgets that way, according to the American Civil Liberties Union.

"Imposing monetary penalties that bury people under mountains of accumulating debt has devastating consequences on individuals, families and entire communities, particularly low-income communities of color,” said Nusrat Choudhury, deputy director of the ACLU Racial Justice Program.

The practice often leads low-income defendants further into poverty, crime, prison and recidivism, the liberal Southern Poverty Law Center and libertarian Cato Institute argued in court papers. The American Bar Association noted that nearly two-thirds of prisoners have little prospect of paying the fines and fees after their release.

Timbs' conviction resulted in a year's home detention, five years' probation and about $1,200 in fees. But it was the seizure of his SUV that led to the lawsuit. The 2012 Land Rover LR2 was even a named plaintiff in the case.

Wesley Hottot, senior attorney with the Institute for Justice who argued Timbs' case, said the ruling "should go a long way to curtailing what is often called ‘policing for profit.’ "

"Police and prosecutors employ forfeiture to take someone’s property, then sell it and keep the profits to fund their departments," Hottot said. "This gives them a direct financial incentive to abuse this power and impose excessive fines.”

Brianne Gorod, chief counsel at the liberal Constitutional Accountability Center, said, "Significantly, this case has united progressives and conservatives – both advocates and the justices themselves – in a shared understanding of the original meaning of the Constitution."

The seizure had been defended by several national municipal groups. They argued in court papers that the vehicle was used in heroin trafficking that could have generated hefty profits and that its forfeiture properly left Timbs without the ride he needed for his craft.

The case came to the Supreme Court from Indiana's highest court, which ruled that the excessive fines clause doesn't apply to the states. Nearly all rights, such as the Second Amendment's right to bear arms for self-defense, have been extended. The right to a unanimous jury verdict under the Sixth Amendment has not.

Ginsburg noted that other elements of the Eighth Amendment already are applicable to the states. The amendment states that “excessive bail shall not be required, nor excessive fines imposed, nor cruel and unusual punishments inflicted.”

"For good reason, the protection against excessive fines has been a constant shield throughout Anglo-American history," Ginsburg wrote. "Exorbitant tolls undermine other constitutional liberties. Excessive fines can be used, for example, to retaliate against or chill the speech of political enemies."