A judge ruled Tuesday that the state cannot seek punitive damages against three lead paint manufacturers found liable for creating a public nuisance in Rhode Island.

The companies — Sherwin-Williams Co., NL Industries Inc. and Millennium Holdings LLC — still must pay to clean up the mess caused by lead paint, which could amount to billions of dollars.