The owner of a Red Hook cherry factory killed himself Tuesday when officials searched the building, according to the Brooklyn District Attorney's Office.

Arthur Mondella, who owned Dell's Maraschino Cherries at 175-177 Dikeman St., initially cooperated with inspectors from the Brooklyn DA's office and city and state agencies who were conducting a search regarding "environmental crimes," according to a spokeswoman for the DA's office.

During the investigation, Mondella, 57, "excused himself to his private bathroom where he apparently shot himself," and died at an undisclosed hospital, the spokeswoman said in a statement.

The NYPD declined to comment about the nature of the investigation into Mondella's company and the DA's office declined to give further details.