DES MOINES, Iowa (AP) — The Iowa Supreme Court has reversed a longstanding precedent that allowed landowners to sue for damages when a neighboring hog farm causes water pollution or odor problems that affect quality of life.

A majority of the court concluded Thursday that a 2004 decision was wrong.

The reversal is a significant blow to property owners who live in rural areas who want to take legal action over expanding hog farms.

It’s a victory for the agriculture industry in Iowa because it strengthens the immunity law protecting livestock farmers from nuisance lawsuits.

Iowa is the nation’s leading pork producer with 23 million pigs.