BMW will pay up to $477.7 million to settle a class action lawsuit filed by BMW 5-Series owners due to water damage issues.

The settlement, filed in U.S. District Court in New York last week, covers owners of 2004-2010 E60 BMW 5-Series models. It says that electronic components in the spare tire well could be damaged by clogged sunroof drainage tubes or by other means.

The settlement covers approximately 318,000 vehicles and permits owners to receive up to $1,5000 in compensation for previous repairs. Additionally, BMW dealerships across the United States will affix warning labels to affected 5-Series models instructing owners not to spill liquids in the trunk.

Based off warranty claims, complaints and technical service bulletins filed with the U.S. National Highway Traffic Administration, owners say that BMW was aware of the issues as early as 2004. BMW denies this, Reuters reports.

Although the settlement still needs to be approved by U.S. District Judge Katherine Forrest, BMW will also pay around $1.8 million to cover all the legal expenses of the suing owners.

PHOTO GALLERY