(CNN) Bear repellent sent two dozen workers at an Amazon fulfillment center in New Jersey to hospitals on Wednesday after a machine punctured an aerosol canister of the spray, causing it to discharge toxic fumes inside the building, a town spokesman told CNN.

Employees reported difficulty breathing and burning sensations in their eyes and throat, said John Nalbone, a spokesman for Robbinsville Township, where the fulfillment center is located.

Emergency personnel responded to a morning 911 call that 54 workers at the facility were experiencing symptoms, Nalbone said. Twenty-four workers, including one in critical condition, were taken to hospitals, he said.

All affected workers either have been released or will leave the hospital by Thursday evening, Amazon spokeswoman Rachael Lighty said.

A preliminary investigation said the canister fell off a shelf, but Nalbone further clarified that an automated machine punctured a 9-ounce can of the bear repellent.

Read More