BISMARCK, N.D. (AP) — The company responsible for the largest oil field spill in North Dakota has pleaded guilty to criminal charges after reaching an agreement with the federal government to pay $15 million in fines.

Summit Midstream Partners was charged for negligently discharging oil and for failing to immediately report the spill, which occurred north of Williston over a period of five months in 2014 and 2015. A pipeline leaked 700,000 barrels, or 29 million gallons, of produced water, which is highly saturated saltwater that comes up in wells along with oil and gas.

Produced water can contain oil. Some of the wastewater reached Blacktail Creek, which eventually flows into the Missouri River.