Updated

The Supreme Court ruled Wednesday that Colorado's practice of not automatically refunding court fees and other costs to people convicted of crimes but later exonerated violates the Constitution.

The 7-1 decision sided with two people whose convictions for sexual offenses were later thrown out. One paid about $700 in court fees, including victim restitution, while the other paid more than $4,400 in similar costs.

Colorado law had required people cleared of wrongdoing to recover their costs in a separate civil lawsuit. But they could not get a refund unless they proved their innocence by clear and convincing evidence.

Justice Ruth Bader Ginsburg said those hurdles violated the due process rights of criminal defendants.

"The state may not retain their money simply because their convictions were in place when the funds were taken, for once those convictions were erased, the presumption of Nelson's and Madden's innocence was restored," Ginsburg said.

Colorado appeared to be the only state that didn't automatically refund such fees.

Justice Samuel Alito wrote separately to say that that the majority went too far in saying that an award of victim restitution should always be returned when a defendant's conviction is reversed.

Justice Clarence Thomas dissented, saying the defendants did not have a constitutional right to recover costs and fees they paid to the state.

Newly confirmed Justice Neil Gorsuch did not take part in the case, which was argued before he took his seat on the court.