A New York City cocktail cherries company that had a hidden marijuana growing operation in its basement has pleaded guilty to charges of possessing marijuana and failing to monitor wastewater it was dumping into the city's sewer system.

Dell's Maraschino Cherries was charged Tuesday in Brooklyn Supreme Court. It will pay $1.2 million under an agreement to settle the criminal case.

Detectives investigating an environmental crimes case raided the company's Brooklyn factory in February and smelled marijuana. During the raid company owner Arthur Mondella locked himself in a bathroom and fatally shot himself.

Company attorney Michael Farkas says the deal will allow the company to remain open. He says it's working to come up with the settlement funds.