OMAHA, Neb. (AP) — BNSF Railway has agreed to pay a $1.5 million settlement after an oil spill into northwest Iowa waters three years ago.

In a settlement filed Thursday, the railroad company agreed to pay the settlement to the Environmental Protection Agency.

About 160,000 gallons of oil leaked into floodwaters near Doon, Iowa, in June 2018.

The National Transportation Safety Board said heavy rain washed out tracks and flooded a tributary of the nearby Little Rock River before the 32-car train derailed.

BNSF denied any fault and both parties said they agreed to settle the complaint to avoid costly litigation.