Millions of Americans have had their driver’s licenses taken away not because they got drunk and got behind the wheel, or because they caused an accident and hurt someone: They lost their licenses because they were too poor to pay court costs or traffic fines, which can run into hundreds and sometimes thousands of dollars.

About 40 states have such laws on the books that suspend or revoke licenses of drivers. But now, a federal district judge has ruled that one of these laws, in Tennessee, violates the due process and equal protection clauses of the 14th Amendment to the Constitution.

Experts say it is the first time a federal judge has formally declared any of these state laws unconstitutional. Critics have long argued that the laws make it harder for poor people to pay their debts, because the only way for them to do so — to get in the car and go to work — means breaking the law. And if they do drive, it means even more fees piled on if they get caught.

The ruling does not affect states other than Tennessee. But it still is a major victory for advocates of the poor who have targeted license revocation laws as some of the worst examples of statutes that effectively criminalize poverty, where fees and fines and bail money for even minor infractions can sweep people into a vortex of mounting debts out of which many will never climb.