Employees move packages inside an Amazon fulfillment center in Robbinsville, New Jersey, on Nov. 28, 2016.
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.

Bear repellent spray is similar to a can of pepper spray and is intended to deter an aggressive or charging bear. The US Fish and Wildlife Service recommends bear repellent spray as both safer and more effective than a firearm in fending off bear attacks.

Lighty said a damaged canister caused the problem.

“A damaged aerosol can dispensed strong fumes in a contained area of the facility,” she said. “The safety of our employees is always our top priority and a full investigation is already underway. We’d like to thank all of the first responders who helped with today’s incident.”

The 911 call came in at approximately 8:50 a.m., Nalbone said. One wing of the 1.3 million square foot center was evacuated, he added.

CNN’s Eric Levenson contributed to this report.