Exxon Mobil Corp. subsidiary XTO Energy will have to face criminal charges for allegedly dumping tens of thousands of gallons of hydraulic fracturing waste at a Marcellus Shale drilling site in 2010, according to a Pennsylvania judge’s ruling on Thursday.

Following a preliminary hearing, Magisterial District Judge James G. Carn decided that all eight charges against Exxon — including violations of both the state Clean Streams Law and the Solid Waste Management Act — will be “held for court,” meaning there is enough evidence to take the fossil fuel giant to trial over felony offenses.

Pennsylvania’s Attorney General filed criminal charges back in September, claiming Exxon had removed a plug from a wastewater tank, leading to 57,000 gallons of contaminated water spilling into the soil. The Exxon subsidiary had contested the criminal charges, claiming there was “no lasting environmental impact,” and that the charges could “discourage good environmental practices” from guilty companies.

“The action tells oil and gas operators that setting up infrastructure to recycle produced water exposes them to the risk of significant legal and financial penalties should a small release occur,” Exxon said at the time.

Hydraulic fracturing is a method of extracting fossil fuels that generally increases the flow of oil or gas from a well. It is done by injecting high-pressure water and chemicals miles deep into the ground into subsurface rock, effectively “fracturing” the rock and allowing more spaces for oil and gas to come through. The tactic is generally paired with horizontal drilling.

The high-pressure water and chemical injections generally result in a good amount of wastewater, which is what Exxon is charged with illegally dumping. The specific chemical makeup of that wastewater is a large part of why the practice is so controversial, as public disclosure of what exactly is used in the water is largely self-regulated by the fracking companies. Thanks to laws pushed by corporate front groups like the American Legislative Exchange Council (ALEC), sponsored by ExxonMobil, states have allowed minimum disclosure of the chemicals used in the fluid. Though Pennsylvania does now require disclosure to regulators, it has a “gag rule” banning doctors from talking about the health risks.

The most recent study of health risks related to fracking was released in mid-December by the journal Endocrinology, which found the presence of hormone-disrupting chemicals in surface water and groundwater samples in Garfield County, Colorado — one county at the center of the U.S. fracking boom. The chemicals have been linked to infertility, birth defects, and cancer.

Additionally, a July study from the Proceedings of the National Academy Sciences of USA found that the closer residents live to wells used in fracking, the more likely drinking water is contaminated, with 115 of 141 wells found to contain methane.