CENTRAL ISLIP, N.Y. (CBSNewYork) — A man ended his criminal trial Wednesday by changing his plea to guilty in a highly-publicized case of toxic dumping on Long Island.

Thomas Datre Jr., 42, of St. James, had been on trial since Feb. 23 in Central Islip, along with his father, Thomas Datre Sr., and four family-owned companies. They were charged with dumping tons of contaminated construction debris at four locations in Suffolk County.

READ MORE: Police: Suspect Robbed Bank 10 Minutes Before Shooting Man In Union Square Subway Station

Datre Jr. pleaded guilty to four felony charges of third-degree endangering the public health, safety or environment, according to the Suffolk County District Attorney’s office. He will be sentenced to up to three years in prison, and is responsible for the restoration of the areas where the debris was dumped.

The dumping turned a public park into a crime scene, and prosecutors claim it endangered drinking water and veterans.

Prosecutors had said the men dumped hundreds of tractor trailer loads of filthy demolition debris and tried to pass it off as a donation.

READ MORE: Hell's Kitchen Residents Fighting To Stop Local Drug Store From Closing: 'It's Inhumane For The Residents Of The Neighborhood'

They alleged that fill which was “chock full of hazardous substances” was used to level land for housing for Gulf War Veterans and to refurbish soccer fields at Roberto Clemente Park in Brentwood.

Asbestos and pesticides were found in debris dumped at four sites including wetlands. Prosecutors said the Datres were motivated by greed, avoiding fees and permits while endangering Long Island’s drinking water.

The Datres’ attorneys had argued that they were being prosecuted for political reasons, and would prove the donated fill posed no health risk and was perfectly legal.

MORE NEWS: Storm Topples Large Tree Onto Car In Jackson Heights, Queens; Hollis Residents Remain Mindful Of Prior Storm Devastation

Under the guilty plea, Datre Jr. is responsible for cleaning up Roberto Clemente Park so it can be an active playground, soccer field and recreational facility. He is also responsible for cleaning up the wetlands area on the Islip-Babylon town line in Deer Park, and on the corner of Sage Street and Islip Avenue in Central Islip.